EFICIENCIA DE USO DE AGUA EN QUINCE GENOTIPOS DE PAPA (Solanum tuberosum L.) BAJO CONDICIONES DE ESTRÉS HÍDRICO POR SEQUÍA

Author

Grupo C

1 Resumen

2 Introducción

3 Marco teórico

4 Materiales

4.1 Lugar de ejecución

El experimento se realizó en el invernadero 10 A del Centro Internacional de la Papa (CIP), ubicado en Lima, Perú. Este lugar ofrece un entorno controlado ideal para la investigación en cultivos sensibles al estrés hídrico, como la papa. Situado a una altitud de 244 metros sobre el nivel del mar, el invernadero permitió simular condiciones de sequía sin variabilidad externa, proporcionando un control riguroso sobre variables críticas como temperatura, humedad y régimen de riego.

library(knitr)
knitr::include_graphics("C:/Users/HP/OneDrive/Documentos/INGENERIA AGRONOMA/Ingenieria Agronoma VIII/PROGRAMACIÓN Y ANÁLISIS DE DATOS/UNIDAD II/LG.png")

echo=FALSE 

Este tipo de entorno es clave en estudios de estrés abiótico porque permite observar respuestas fisiológicas y morfológicas en las plantas sin interferencia de factores externos no controlados. Las temperaturas promedio máximas y mínimas dentro del invernadero, de 24 °C y 15 °C respectivamente, junto con una humedad relativa del 80%, crearon un ambiente estable que facilitará el monitoreo preciso de las respuestas de las plantas y la evaluación de la eficiencia. en el uso del agua (EUA). Además, el CIP es un referente global en investigación en papa, lo que garantiza un acceso a infraestructura y metodologías avanzadas para el análisis de cultivos bajo estrés hídrico.

4.2 Descripción de las variables

Peso seco de las hojas (g): El peso seco de las hojas es una medida de la biomasa acumulada en este órgano tras la eliminación de su contenido de agua tras someterlas a un proceso de secado en estufa a 80 °C durante tres días. Este parámetro es clave porque las hojas son el principal órgano fotosintético y, en condiciones de estrés hídrico, una mayor biomasa foliar puede relacionarse tanto con la eficiencia fotosintética como con la resistencia a la sequía. Sin embargo, un exceso de biomasa foliar también puede incrementar la transpiración, lo que en condiciones de baja disponibilidad de agua puede ser desventajoso.

En el estudio, los valores de peso seco de las hojas variaron significativamente entre los genotipos y entre los tratamientos de riego y sequía regulada.

Condiciones de riego: Genotipos como CIP398098.119 presentaron mayores valores de peso seco en riego, lo cual indica un buen desarrollo foliar bajo condiciones de disponibilidad de agua, promoviendo una alta capacidad fotosintética y crecimiento.

Condiciones de sequía: En condiciones de sequía, el peso seco de las hojas disminuyó significativamente en varios genotipos, excepto en los más adaptados, como CIP392797.22, que mantuvo valores estables. Este comportamiento refleja una estrategia adaptativa para reducir la transpiración en un ambiente con limitación hídricaetación: Los genotipos que mantienen su biomasa foliar bajo estrés pueden aprovechar una mayor capacidad fotosintética sin comprometer su capacidad hídrica, una ventaja que los hace candidatos ideales para zonas con estrés hídrico intermitente.

Peso seco de la raíz (g): El peso seco de la raíz representa la biomasa acumulada en las raíces tras el secado, proporcionando información valiosa sobre el sistema de anclaje y absorción de agua y nutrientes de la planta. En cultivos como la papa, donde el sistema radical es naturalmente poco profundo, un mayor desarrollo radicular puede representar una ventaja adaptativa en situaciones de estrés hídrico, permitiendo que la planta acceda a reservas hídricas a mayor profundidad o aproveche de manera más efectiva la humedad limitada. .

En el experimento, los genotipos que presentaron un peso seco de raíz más alto en condiciones de sequía, como CIP392797.22, se destacan por su capacidad de sostener el desarrollo radicular incluso bajo condiciones adversas. Esto puede interpretarse como una estrategia de adaptación mediante el ajuste osmótico y la inversión en biomasa radicular, lo que favorece la absorción en suelos de baja humedad.

Condiciones de riego y sequía : Los genotipos como CIP398098.119 y CIP397077.16 muestran incrementos en biomasa radicular bajo sequía, lo cual indica un ajuste osmótico y una mayor eficiencia en la búsqueda de agua en el suelo. En cambio, otros genotipos como CIP720088 presentaron una reducción en el peso seco de la raíz, mostrando limitaciones adaptativas frente al estrés hídrico.

Peso seco del tubérculo (g): El peso seco del tubérculo es una medida clave del rendimiento en el cultivo de papa, ya que representa la masa de los tubérculos tras eliminar el contenido de agua. Este valor permite evaluar directamente la eficiencia en la producción de biomasa de la planta y es fundamental para determinar el rendimiento en diferentes condiciones de riego. Dado que el tubérculo es el órgano de almacenamiento de nutrientes y el producto final cosechado, una masa seca adecuada bajo estrés hídrico indica que el genotipo ha mantenido su productividad a pesar de la limitación de agua. En condiciones de sequía, el rendimiento se reduce considerablemente debido a la menor disponibilidad de agua para los procesos de translocación y expansión celular en los tubérculos. Sin embargo, los genotipos que mantuvieron altos niveles de biomasa en los tubérculos bajo estrés indican una mayor eficiencia en el uso de los recursos disponibles y una potencial tolerancia al estrés hídrico. Para los productores, esta variable ayuda a identificar variedades de papa que mantendrán un rendimiento económico aceptable incluso en escenarios de riego limitado, ofreciendo una alternativa más sostenible en regiones con problemas de disponibilidad de agua.

Los valores de peso seco de los tubérculos entre los tratamientos de riego y sequía muestran una variabilidad importante: En riego, genotipos como CIP398208.620 lograron un alto peso seco en tubérculo, lo que indica un buen rendimiento en condiciones óptimas.

En condiciones de sequía: Bajo estrés, el rendimiento disminuyó notablemente en la mayoría de los genotipos, pero algunos, como CIP392797.22, lograron sostener valores aceptables de peso seco en los tubérculos, lo cual es prometedor para la selección en programas de mejora.

Interpretación: Mantener un rendimiento relativamente alto en condiciones de sequía muestran una buena eficiencia en el uso de los recursos disponibles, un factor crucial para el desarrollo de variedades tolerantes al estrés hídrico en papa.

Transpiración total (l): La transpiración total se calcula mediante la diferencia en el peso de las macetas antes y después del riego, tomando en cuenta la cantidad de agua añadida. Este valor representa la cantidad total de agua perdida por la planta a través de la transpiración y es crucial en estudios de sequía para evaluar cómo las plantas gestionan el uso de agua. La transpiración está directamente relacionada con la capacidad de la planta para regular su temperatura y facilitar el transporte de nutrientes desde las raíces a las hojas. Sin embargo, en condiciones de sequía, una alta transpiración puede ser desventajosa al agotar rápidamente el agua disponible en el suelo. En este contexto, la transpiración total permite identificar genotipos que tienen mecanismos fisiológicos para moderar la pérdida de agua, tales como un cierre estomático eficiente o un ajuste en el área foliar. Genotipos que muestran una transpiración moderada bajo estrés hídrico suelen tener una mayor eficiencia en el uso del agua, lo que es favorable para la selección de cultivares adaptados a climas áridos o regiones donde el riego es limitado.

Del estudio, se observaron diferencias en los valores de transpiración total entre genotipos y tratamientos. Genotipos como el CIP398098.119, que presenta una alta transpiración en condiciones de riego y una regulación más baja en sequía, indican una adaptación óptima al estrés, utilizando un enfoque de “derroche” de agua en condiciones favorables y “ahorro” bajo estrés. Este comportamiento es ventajoso, ya que permite un crecimiento vigoroso en ambientes húmedos y una adaptación rápida cuando el agua es limitada.

Condiciones de riego: Los genotipos CIP398098.119 y CIP398208.219 presentaron altos niveles de transpiración bajo riego, lo cual refleja su capacidad de aprovechar el agua cuando está disponible.

Condiciones de sequía: En estrés hídrico, la transpiración disminuyó en todos los genotipos, siendo notable en CIP720088, que tuvo una reducción considerable. Este comportamiento es una estrategia para minimizar la pérdida de agua y conservar el recurso en condiciones limitadas.

Eficiencia del uso del agua (g/l): La eficiencia en el uso del agua es una medida de la cantidad de biomasa o peso seco de tubérculos que produce la planta por cada litro de agua consumida. Este parámetro es crítico en la agricultura sostenible y es especialmente relevante en el contexto de sequía, donde se necesita maximizar la producción con la menor cantidad de agua posible. En este estudio, se la calcula específicamente para el rendimiento de los tubérculos y para la biomasa total, proporcionando una visión integral de qué tan eficientemente cada genotipo convierte el agua en rendimiento útil. Este, es un criterio clave para identificar genotipos que no solo sobreviven al estrés hídrico, sino que mantienen una productividad óptima. En la práctica agronómica, seleccionar cultivares con alta eficiencia en el uso del agua permite reducir la dependencia del riego, disminuyendo costos y haciendo el cultivo de papa más viable en regiones de escasez hídrica. Además, una alta eficiencia del uso del agua es indicativa de genotipos con adaptaciones morfofisiológicas, como la regulación estomática y una mejor relación entre área foliar y transpiración, que optimizan la fotosíntesis y minimizan la pérdida de agua.

Los valores de eficiencia en el uso del agua en el estudio, revelaron que genotipos como CIP398190.89 y CIP397077.16 presentaron altos niveles de eficiencia bajo condiciones de sequía. Este resultado sugiere que estos genotipos poseen características fisiológicas que maximizan la productividad por unidad de agua, probablemente a través de la regulación estomática, la optimización de la fotosíntesis y una alta retención de biomasa en órganos productivos. Estos genotipos serán excelentes candidatos en programas de mejora para zonas afectadas por el cambio climático, donde la eficiencia hídrica es prioritaria.

Condiciones de riego: En riego, los genotipos presentan valores más bajos de eficiencia en el uso del agua, ya que no se limita la disponibilidad de agua, son , genotipos como CIP397077.16 que alcanzaron una eficiencia de 12.51 g/l, destacando como uno de los más eficientes.

Condiciones de Sequía: En estrés hídrico, los valores de eficiencia en el uso del agua incrementaron en genotipos como CIP392797.22 (12.04 g/l), lo cual muestra su capacidad de mantener rendimiento a pesar de la limitación de agua, maximizando cada litro consumido.

Conclusión comparativa de variables

Los valores obtenidos para cada variable ofrecen una visión completa sobre la adaptabilidad de los genotipos de papa en condiciones de estrés hídrico. Los genotipos CIP392797.22 y CIP398098.119 mostraron características sobresalientes en términos de retención de biomasa foliar, desarrollo radicular, rendimiento en tubérculos y eficiencia del uso del agua, lo cual indica una alta tolerancia al estrés y eficiencia en el aprovechamiento de recursos hídricos. Lo que resulta ser información fundamental para los programas de mejoramiento genético de papa, ya que permite identificar los genotipos más adecuados para entornos con disponibilidad de agua limitada, promoviendo así una agricultura resiliente al cambio climático.

5 Métodos

5.1 Desinfección de materiales

Se desinfectaron macetas, tutores de bambú y mallas plásticas sumergiéndolos en una solución de 30 g de hipoclorito de calcio en 120 L de agua. Luego, se enjuagaron y secaron.

5.2 Preparación de sustrato

Se utilizó una mezcla de sustrato SOGEMIX SM-2 (75% musgo de turba, perlita, vermiculita y piedra caliza) con tierra de Huancayo, desinfectada con vapor a 100 °C por 8 horas y enfriada 48 horas. Cada maceta recibió 2 kg de sustrato y fertilización fraccionada (170-60-270) al inicio y a los 40 días después de la siembra.

5.3 Siembra de tubérculos

Los tubérculos fueron tratados con RTNDJTE (200 ml) en una cámara sellada por 72 horas para romper la dormancia. Luego, se llevaron a cámara de luz difusa para suberificar las yemas y proceder a sembrar.

5.4 Tratamiento de riego

Las plantas se regaron interdiariamente hasta el tratamiento. A los 30 DDS, se saturaron las macetas, drenando durante la noche y sellándolas con bolsas de polietileno. A los 45 DDS, se inició la sequía regulada con la metodología de lisímetro, reduciendo 150 ml de agua por riego y ajustando el riego normal.

Las macetas se dividieron en dos tratamientos:

a) Riego normal, aplicando agua según la evapotranspiración y manteniendo capacidad de campo.

b) Sequía controlada, reduciendo gradualmente el agua hasta alcanzar un 20% de transpiración normalizada antes de la cosecha final.

5.5 Diseño y análisis estadístico

El diseño experimental utilizado fue de Parcelas Divididas (Adecuado para características de evaluación). La unidad experimental fue de una planta y/o macetas, fueron dos factores analizados: Genotipo de la papa (consta de 13 clones y 2 variedades de papa) y tipos de riego (Riego normal y sequía controlada). Fueron 5 Unidades experimentales por tratamiento, distribuidas al azar.

library(knitr)
knitr::include_graphics("C:\\Users\\HP\\OneDrive\\Documentos\\INGENERIA AGRONOMA\\Ingenieria Agronoma VIII\\PROGRAMACIÓN Y ANÁLISIS DE DATOS\\UNIDAD II\\DE.png")

Distribución espacial del experimento con el diseño de parcelas divididas dentro del invernadero

5.6 Análisis de Datos

Los datos procesados y analizados en el software Estadístico R c.3.0.3. Se usó el paquete “car” para detectar valores atípicos. El paquete Agricolae para Analisis de varianza (ANVA) y correlación de Pearson, Con el “FacorMineR” se hizo el análisis de componentes principales. Con el Software estadístico “GraphPad Prism 6 se realizó el análisis de regresión lineal y figuras.

6 Resultados

source('https://inkaverse.com/setup.r')
ℹ The googlesheets4 package is using a cached token for
  '7577995921@untrm.edu.pe'.
ℹ The googledrive package is using a cached token for
  '7577995921@untrm.edu.pe'.
url <- "https://docs.google.com/spreadsheets/d/15r7ZwcZZHbEgltlF6gSFvCTFA-CFzVBWwg3mFlRyKPs/edit?gid=172957346#gid=172957346"

gs <- url %>% 
  as_sheets_id()

fb <- gs %>% 
  range_read("fb")
Auto-refreshing stale OAuth token.
✔ Reading from "LA MOLINA 2014 POTATO WUE (FB)".
✔ Range ''fb''.
str(fb)
tibble [150 × 18] (S3: tbl_df/tbl/data.frame)
 $ riego  : chr [1:150] "sequia" "sequia" "irrigado" "sequia" ...
 $ geno   : chr [1:150] "G01" "G02" "G01" "G02" ...
 $ block  : num [1:150] 2 4 3 1 2 5 1 4 2 1 ...
 $ bloque : chr [1:150] "II" "IV" "III" "I" ...
 $ spad_29: num [1:150] 56.3 52.7 49.2 55.5 58.2 43.5 57.4 56.1 61 60.3 ...
 $ spad_83: num [1:150] 41.1 47.9 41.6 44.2 32.6 37.8 42.5 35.9 57.5 41.8 ...
 $ rwc_84 : num [1:150] 61.5 63.2 67.7 64.9 74.5 ...
 $ op_84  : num [1:150] -2.43 -3.03 -2.5 -2.4 -2.27 ...
 $ leafdw : num [1:150] 13.28 9.42 18.22 8.84 14.55 ...
 $ stemdw : num [1:150] 14.87 8.63 24.19 6.58 12.63 ...
 $ rootdw : num [1:150] 3.83 2.1 3.16 2 1.83 2.83 2.28 3.65 4.04 4.17 ...
 $ tubdw  : num [1:150] 19.8 17.7 38 13.5 51.1 ...
 $ biomdw : num [1:150] 51.8 37.8 83.6 30.9 80.2 ...
 $ hi     : num [1:150] 0.45 0.43 0.455 0.437 0.638 ...
 $ ttrans : num [1:150] 4.5 3.54 8.39 2.9 7.37 ...
 $ wue    : num [1:150] 11.51 10.69 9.97 10.65 10.88 ...
 $ twue   : num [1:150] 4.4 4.99 4.53 4.65 6.94 ...
 $ lfa    : num [1:150] 2900 2619 7579 2450 5413 ...

Variables evaluadas en el experimento

6.1 Peso seco de las hojas (g)

6.1.1 Modelo lineal de leafdw

ANOVA

modelo <- aov(formula = leafdw ~  bloque + riego + geno + riego*geno
          , data = fb)

anova(modelo)
## Analysis of Variance Table
## 
## Response: leafdw
##             Df  Sum Sq Mean Sq  F value               Pr(>F)    
## bloque       4   26.13    6.53   1.1810              0.32286    
## riego        1 1065.87 1065.87 192.6695 < 0.0000000000000002 ***
## geno        14 2437.24  174.09  31.4688 < 0.0000000000000002 ***
## riego:geno  14  172.96   12.35   2.2332              0.01023 *  
## Residuals  116  641.72    5.53                                  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Prueba de normalidad

plot(modelo)

Interacción de niveles de riego y Geno

library(ggplot2)
ggplot(fb, aes(x = geno, y = leafdw, colour = riego)) +
  geom_boxplot(outlier.colour = "red", outlier.shape = 16, outlier.size = 2) +
  labs(title = "Boxplot con interacción de niveles de riego y genotipo",
       x = "Interacción Riego y Genotipo",
       y = "Peso seco de las hojas (g)")

  theme_minimal() +
  theme(axis.text.x = element_text(angle = 45, hjust = 1))  # Inclinar etiquetas del eje X
## List of 136
##  $ line                            :List of 6
##   ..$ colour       : chr "black"
##   ..$ linewidth    : num 0.5
##   ..$ linetype     : num 1
##   ..$ lineend      : chr "butt"
##   ..$ arrow        : logi FALSE
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_line" "element"
##  $ rect                            :List of 5
##   ..$ fill         : chr "white"
##   ..$ colour       : chr "black"
##   ..$ linewidth    : num 0.5
##   ..$ linetype     : num 1
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_rect" "element"
##  $ text                            :List of 11
##   ..$ family       : chr ""
##   ..$ face         : chr "plain"
##   ..$ colour       : chr "black"
##   ..$ size         : num 11
##   ..$ hjust        : num 0.5
##   ..$ vjust        : num 0.5
##   ..$ angle        : num 0
##   ..$ lineheight   : num 0.9
##   ..$ margin       : 'margin' num [1:4] 0points 0points 0points 0points
##   .. ..- attr(*, "unit")= int 8
##   ..$ debug        : logi FALSE
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ title                           : NULL
##  $ aspect.ratio                    : NULL
##  $ axis.title                      : NULL
##  $ axis.title.x                    :List of 11
##   ..$ family       : NULL
##   ..$ face         : NULL
##   ..$ colour       : NULL
##   ..$ size         : NULL
##   ..$ hjust        : NULL
##   ..$ vjust        : num 1
##   ..$ angle        : NULL
##   ..$ lineheight   : NULL
##   ..$ margin       : 'margin' num [1:4] 2.75points 0points 0points 0points
##   .. ..- attr(*, "unit")= int 8
##   ..$ debug        : NULL
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ axis.title.x.top                :List of 11
##   ..$ family       : NULL
##   ..$ face         : NULL
##   ..$ colour       : NULL
##   ..$ size         : NULL
##   ..$ hjust        : NULL
##   ..$ vjust        : num 0
##   ..$ angle        : NULL
##   ..$ lineheight   : NULL
##   ..$ margin       : 'margin' num [1:4] 0points 0points 2.75points 0points
##   .. ..- attr(*, "unit")= int 8
##   ..$ debug        : NULL
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ axis.title.x.bottom             : NULL
##  $ axis.title.y                    :List of 11
##   ..$ family       : NULL
##   ..$ face         : NULL
##   ..$ colour       : NULL
##   ..$ size         : NULL
##   ..$ hjust        : NULL
##   ..$ vjust        : num 1
##   ..$ angle        : num 90
##   ..$ lineheight   : NULL
##   ..$ margin       : 'margin' num [1:4] 0points 2.75points 0points 0points
##   .. ..- attr(*, "unit")= int 8
##   ..$ debug        : NULL
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ axis.title.y.left               : NULL
##  $ axis.title.y.right              :List of 11
##   ..$ family       : NULL
##   ..$ face         : NULL
##   ..$ colour       : NULL
##   ..$ size         : NULL
##   ..$ hjust        : NULL
##   ..$ vjust        : num 1
##   ..$ angle        : num -90
##   ..$ lineheight   : NULL
##   ..$ margin       : 'margin' num [1:4] 0points 0points 0points 2.75points
##   .. ..- attr(*, "unit")= int 8
##   ..$ debug        : NULL
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ axis.text                       :List of 11
##   ..$ family       : NULL
##   ..$ face         : NULL
##   ..$ colour       : chr "grey30"
##   ..$ size         : 'rel' num 0.8
##   ..$ hjust        : NULL
##   ..$ vjust        : NULL
##   ..$ angle        : NULL
##   ..$ lineheight   : NULL
##   ..$ margin       : NULL
##   ..$ debug        : NULL
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ axis.text.x                     :List of 11
##   ..$ family       : NULL
##   ..$ face         : NULL
##   ..$ colour       : NULL
##   ..$ size         : NULL
##   ..$ hjust        : num 1
##   ..$ vjust        : num 1
##   ..$ angle        : num 45
##   ..$ lineheight   : NULL
##   ..$ margin       : 'margin' num [1:4] 2.2points 0points 0points 0points
##   .. ..- attr(*, "unit")= int 8
##   ..$ debug        : NULL
##   ..$ inherit.blank: logi FALSE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ axis.text.x.top                 :List of 11
##   ..$ family       : NULL
##   ..$ face         : NULL
##   ..$ colour       : NULL
##   ..$ size         : NULL
##   ..$ hjust        : NULL
##   ..$ vjust        : num 0
##   ..$ angle        : NULL
##   ..$ lineheight   : NULL
##   ..$ margin       : 'margin' num [1:4] 0points 0points 2.2points 0points
##   .. ..- attr(*, "unit")= int 8
##   ..$ debug        : NULL
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ axis.text.x.bottom              : NULL
##  $ axis.text.y                     :List of 11
##   ..$ family       : NULL
##   ..$ face         : NULL
##   ..$ colour       : NULL
##   ..$ size         : NULL
##   ..$ hjust        : num 1
##   ..$ vjust        : NULL
##   ..$ angle        : NULL
##   ..$ lineheight   : NULL
##   ..$ margin       : 'margin' num [1:4] 0points 2.2points 0points 0points
##   .. ..- attr(*, "unit")= int 8
##   ..$ debug        : NULL
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ axis.text.y.left                : NULL
##  $ axis.text.y.right               :List of 11
##   ..$ family       : NULL
##   ..$ face         : NULL
##   ..$ colour       : NULL
##   ..$ size         : NULL
##   ..$ hjust        : num 0
##   ..$ vjust        : NULL
##   ..$ angle        : NULL
##   ..$ lineheight   : NULL
##   ..$ margin       : 'margin' num [1:4] 0points 0points 0points 2.2points
##   .. ..- attr(*, "unit")= int 8
##   ..$ debug        : NULL
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ axis.text.theta                 : NULL
##  $ axis.text.r                     :List of 11
##   ..$ family       : NULL
##   ..$ face         : NULL
##   ..$ colour       : NULL
##   ..$ size         : NULL
##   ..$ hjust        : num 0.5
##   ..$ vjust        : NULL
##   ..$ angle        : NULL
##   ..$ lineheight   : NULL
##   ..$ margin       : 'margin' num [1:4] 0points 2.2points 0points 2.2points
##   .. ..- attr(*, "unit")= int 8
##   ..$ debug        : NULL
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ axis.ticks                      : list()
##   ..- attr(*, "class")= chr [1:2] "element_blank" "element"
##  $ axis.ticks.x                    : NULL
##  $ axis.ticks.x.top                : NULL
##  $ axis.ticks.x.bottom             : NULL
##  $ axis.ticks.y                    : NULL
##  $ axis.ticks.y.left               : NULL
##  $ axis.ticks.y.right              : NULL
##  $ axis.ticks.theta                : NULL
##  $ axis.ticks.r                    : NULL
##  $ axis.minor.ticks.x.top          : NULL
##  $ axis.minor.ticks.x.bottom       : NULL
##  $ axis.minor.ticks.y.left         : NULL
##  $ axis.minor.ticks.y.right        : NULL
##  $ axis.minor.ticks.theta          : NULL
##  $ axis.minor.ticks.r              : NULL
##  $ axis.ticks.length               : 'simpleUnit' num 2.75points
##   ..- attr(*, "unit")= int 8
##  $ axis.ticks.length.x             : NULL
##  $ axis.ticks.length.x.top         : NULL
##  $ axis.ticks.length.x.bottom      : NULL
##  $ axis.ticks.length.y             : NULL
##  $ axis.ticks.length.y.left        : NULL
##  $ axis.ticks.length.y.right       : NULL
##  $ axis.ticks.length.theta         : NULL
##  $ axis.ticks.length.r             : NULL
##  $ axis.minor.ticks.length         : 'rel' num 0.75
##  $ axis.minor.ticks.length.x       : NULL
##  $ axis.minor.ticks.length.x.top   : NULL
##  $ axis.minor.ticks.length.x.bottom: NULL
##  $ axis.minor.ticks.length.y       : NULL
##  $ axis.minor.ticks.length.y.left  : NULL
##  $ axis.minor.ticks.length.y.right : NULL
##  $ axis.minor.ticks.length.theta   : NULL
##  $ axis.minor.ticks.length.r       : NULL
##  $ axis.line                       : list()
##   ..- attr(*, "class")= chr [1:2] "element_blank" "element"
##  $ axis.line.x                     : NULL
##  $ axis.line.x.top                 : NULL
##  $ axis.line.x.bottom              : NULL
##  $ axis.line.y                     : NULL
##  $ axis.line.y.left                : NULL
##  $ axis.line.y.right               : NULL
##  $ axis.line.theta                 : NULL
##  $ axis.line.r                     : NULL
##  $ legend.background               : list()
##   ..- attr(*, "class")= chr [1:2] "element_blank" "element"
##  $ legend.margin                   : 'margin' num [1:4] 5.5points 5.5points 5.5points 5.5points
##   ..- attr(*, "unit")= int 8
##  $ legend.spacing                  : 'simpleUnit' num 11points
##   ..- attr(*, "unit")= int 8
##  $ legend.spacing.x                : NULL
##  $ legend.spacing.y                : NULL
##  $ legend.key                      : list()
##   ..- attr(*, "class")= chr [1:2] "element_blank" "element"
##  $ legend.key.size                 : 'simpleUnit' num 1.2lines
##   ..- attr(*, "unit")= int 3
##  $ legend.key.height               : NULL
##  $ legend.key.width                : NULL
##  $ legend.key.spacing              : 'simpleUnit' num 5.5points
##   ..- attr(*, "unit")= int 8
##  $ legend.key.spacing.x            : NULL
##  $ legend.key.spacing.y            : NULL
##  $ legend.frame                    : NULL
##  $ legend.ticks                    : NULL
##  $ legend.ticks.length             : 'rel' num 0.2
##  $ legend.axis.line                : NULL
##  $ legend.text                     :List of 11
##   ..$ family       : NULL
##   ..$ face         : NULL
##   ..$ colour       : NULL
##   ..$ size         : 'rel' num 0.8
##   ..$ hjust        : NULL
##   ..$ vjust        : NULL
##   ..$ angle        : NULL
##   ..$ lineheight   : NULL
##   ..$ margin       : NULL
##   ..$ debug        : NULL
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ legend.text.position            : NULL
##  $ legend.title                    :List of 11
##   ..$ family       : NULL
##   ..$ face         : NULL
##   ..$ colour       : NULL
##   ..$ size         : NULL
##   ..$ hjust        : num 0
##   ..$ vjust        : NULL
##   ..$ angle        : NULL
##   ..$ lineheight   : NULL
##   ..$ margin       : NULL
##   ..$ debug        : NULL
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ legend.title.position           : NULL
##  $ legend.position                 : chr "right"
##  $ legend.position.inside          : NULL
##  $ legend.direction                : NULL
##  $ legend.byrow                    : NULL
##  $ legend.justification            : chr "center"
##  $ legend.justification.top        : NULL
##  $ legend.justification.bottom     : NULL
##  $ legend.justification.left       : NULL
##  $ legend.justification.right      : NULL
##  $ legend.justification.inside     : NULL
##  $ legend.location                 : NULL
##  $ legend.box                      : NULL
##  $ legend.box.just                 : NULL
##  $ legend.box.margin               : 'margin' num [1:4] 0cm 0cm 0cm 0cm
##   ..- attr(*, "unit")= int 1
##  $ legend.box.background           : list()
##   ..- attr(*, "class")= chr [1:2] "element_blank" "element"
##  $ legend.box.spacing              : 'simpleUnit' num 11points
##   ..- attr(*, "unit")= int 8
##   [list output truncated]
##  - attr(*, "class")= chr [1:2] "theme" "gg"
##  - attr(*, "complete")= logi TRUE
##  - attr(*, "validate")= logi TRUE

6.1.2 Modelo lineal mixto

library(lme4)

library(lmerTest)

model <- lme4::lmer(formula = leafdw ~ riego * geno + (1|bloque), data = fb)
anova(model)
## Analysis of Variance Table
##            npar  Sum Sq Mean Sq  F value
## riego         1 1065.87 1065.87 192.6695
## geno         14 2437.24  174.09  31.4688
## riego:geno   14  172.96   12.35   2.2332

Prueba de normalida

plot(modelo)

Eliminación de datos atípicos

ol <- boxplot(leafdw ~ riego * geno, fb)


ol
## $stats
##       [,1]  [,2]  [,3]  [,4]  [,5]  [,6]  [,7]  [,8]  [,9] [,10] [,11] [,12]
## [1,] 14.29 10.37 15.03  8.84 13.69 10.03 19.77 11.25 16.34  9.75 21.90 14.81
## [2,] 15.01 11.18 15.03  9.42 13.69 10.03 19.77 11.68 16.82 11.26 21.92 14.82
## [3,] 18.22 13.28 15.66  9.51 13.78 10.17 19.78 13.52 19.67 11.51 22.91 16.19
## [4,] 18.44 14.06 16.00  9.81 14.55 10.28 20.38 13.55 19.75 12.28 23.37 17.62
## [5,] 18.66 15.05 16.00 10.35 14.55 10.28 20.38 14.10 19.88 13.25 23.37 19.89
##      [,13] [,14] [,15] [,16] [,17] [,18] [,19] [,20] [,21] [,22] [,23] [,24]
## [1,]  2.03  3.35 16.92 11.25 20.79 14.34  8.94  7.84 18.18  7.26 18.97 11.42
## [2,]  2.36  3.35 17.83 11.25 20.79 15.06 10.20  8.11 18.18  8.28 18.97 11.78
## [3,]  2.57  3.37 18.58 12.12 22.04 15.52 10.54  8.42 18.40 10.56 19.18 12.61
## [4,]  4.00  4.02 18.63 12.76 24.46 17.31 12.40  9.00 19.16 10.58 19.55 13.16
## [5,]  5.99  4.24 18.63 14.07 25.08 18.03 12.40  9.00 19.16 12.85 20.24 14.70
##      [,25] [,26] [,27] [,28] [,29] [,30]
## [1,] 21.38 11.39 22.04 14.33 12.69 10.73
## [2,] 22.58 13.03 22.04 15.91 15.48 11.22
## [3,] 22.93 14.40 23.46 16.13 16.68 12.08
## [4,] 23.80 15.03 24.48 18.43 18.08 12.56
## [5,] 24.04 16.20 27.58 20.96 18.73 13.31
## 
## $n
##  [1] 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5
## 
## $conf
##          [,1]   [,2]    [,3]     [,4]     [,5]      [,6]     [,7]     [,8]
## [1,] 15.79637 11.245 14.9746 9.234427 13.17233  9.993351 19.34898 12.19866
## [2,] 20.64363 15.315 16.3454 9.785573 14.38767 10.346649 20.21102 14.84134
##          [,9]    [,10]    [,11]    [,12]   [,13]   [,14]    [,15]    [,16]
## [1,] 17.59967 10.78927 21.88543 14.21153 1.41118 2.89658 18.01472 11.05304
## [2,] 21.74033 12.23073 23.93457 18.16847 3.72882 3.84342 19.14528 13.18696
##         [,17]    [,18]     [,19]    [,20]    [,21]     [,22]    [,23]   [,24]
## [1,] 19.44679 13.93016  8.985486 7.791128 17.70753  8.934826 18.77017 11.6349
## [2,] 24.63321 17.10984 12.094514 9.048872 19.09247 12.185174 19.58983 13.5851
##         [,25]    [,26]   [,27]    [,28]    [,29]    [,30]
## [1,] 22.06795 12.98681 21.7359 14.34937 14.84285 11.13316
## [2,] 23.79205 15.81319 25.1841 17.91063 18.51715 13.02684
## 
## $out
##  [1] 17.71 11.16 16.41 11.28 10.66  9.50 22.19 14.70 26.84  2.26 20.29  7.69
## [13] 14.07 16.20 10.68 12.48 21.08 14.90 10.07
## 
## $group
##  [1]  3  3  5  5  6  6  7  7 11 14 15 16 17 19 20 21 21 23 27
## 
## $names
##  [1] "irrigado.G01" "sequia.G01"   "irrigado.G02" "sequia.G02"   "irrigado.G03"
##  [6] "sequia.G03"   "irrigado.G04" "sequia.G04"   "irrigado.G05" "sequia.G05"  
## [11] "irrigado.G06" "sequia.G06"   "irrigado.G07" "sequia.G07"   "irrigado.G08"
## [16] "sequia.G08"   "irrigado.G09" "sequia.G09"   "irrigado.G10" "sequia.G10"  
## [21] "irrigado.G11" "sequia.G11"   "irrigado.G12" "sequia.G12"   "irrigado.G13"
## [26] "sequia.G13"   "irrigado.G14" "sequia.G14"   "irrigado.G15" "sequia.G15"
library(inti)

model <- remove_outliers(data = fb
                             , formula = leafdw ~ riego * geno + (1|bloque)
                         , plot_diag = T)
model
## $data
## $data$raw
## # A tibble: 150 × 5
##    index riego    geno  bloque leafdw
##    <chr> <chr>    <chr> <chr>   <dbl>
##  1 1     sequia   G01   II      13.3 
##  2 2     sequia   G02   IV       9.42
##  3 3     irrigado G01   III     18.2 
##  4 4     sequia   G02   I        8.84
##  5 5     irrigado G03   II      14.6 
##  6 6     irrigado G04   V       19.8 
##  7 7     irrigado G01   I       15.0 
##  8 8     irrigado G05   IV      19.9 
##  9 9     sequia   G06   II      19.9 
## 10 10    sequia   G05   I       12.3 
## # ℹ 140 more rows
## 
## $data$clean
##     index    riego geno bloque leafdw
## 1       1   sequia  G01     II  13.28
## 2       2   sequia  G02     IV   9.42
## 3       3 irrigado  G01    III  18.22
## 4       4   sequia  G02      I   8.84
## 5       5 irrigado  G03     II  14.55
## 6       6 irrigado  G04      V  19.77
## 7       7 irrigado  G01      I  15.01
## 8       8 irrigado  G05     IV  19.88
## 9       9   sequia  G06     II  19.89
## 10     10   sequia  G05      I  12.28
## 11     11 irrigado  G01     II  18.44
## 12     12   sequia  G07     II   4.24
## 13     13 irrigado  G08     II  18.63
## 14     14 irrigado  G06    III  23.37
## 15     15 irrigado  G09    III  22.04
## 16     16 irrigado  G10     II  10.20
## 17     17   sequia  G11      I  12.85
## 18     18   sequia  G12    III  11.78
## 19     19 irrigado  G07      I   2.03
## 20     20 irrigado  G04     II  20.38
## 21     21 irrigado  G13     II  23.80
## 22     22 irrigado  G14    III     NA
## 23     23 irrigado  G04     IV  22.19
## 24     24   sequia  G04      V  11.25
## 25     25   sequia  G08      V  11.25
## 26     26   sequia  G04    III  13.52
## 27     27   sequia  G01     IV  14.06
## 28     28 irrigado  G10      I  12.40
## 29     29 irrigado  G08      V  17.83
## 30     30 irrigado  G02      V  16.00
## 31     31 irrigado  G07    III   4.00
## 32     32 irrigado  G08      I  18.58
## 33     33 irrigado  G14      V     NA
## 34     34 irrigado  G03      I  13.69
## 35     35   sequia  G13    III  11.39
## 36     36   sequia  G01      V  11.18
## 37     37   sequia  G03      I  10.66
## 38     38 irrigado  G15    III  15.48
## 39     39 irrigado  G03     IV  16.41
## 40     40 irrigado  G09     IV  25.08
## 41     41 irrigado  G11     II  12.48
## 42     42   sequia  G03      V  10.28
## 43     43   sequia  G11    III  10.56
## 44     44 irrigado  G06      V  22.91
## 45     45   sequia  G05      V  13.25
## 46     46   sequia  G08     IV  12.12
## 47     47 irrigado  G11     IV  18.18
## 48     48   sequia  G11     II   7.26
## 49     49 irrigado  G10    III  16.20
## 50     50   sequia  G06     IV  16.19
## 51     51   sequia  G09      I  14.34
## 52     52 irrigado  G11      I  21.08
## 53     53   sequia  G11     IV  10.58
## 54     54 irrigado  G15     IV  12.69
## 55     55 irrigado  G13     IV  22.93
## 56     56   sequia  G14      V  16.13
## 57     57 irrigado  G02     IV  17.71
## 58     58 irrigado  G09     II  24.46
## 59     59 irrigado  G02    III  15.03
## 60     60   sequia  G08    III  14.07
## 61     61 irrigado  G06     II  21.90
## 62     62   sequia  G13     IV  14.40
## 63     63   sequia  G14    III  15.91
## 64     64   sequia  G04     II  14.10
## 65     65 irrigado  G11    III  18.40
## 66     66 irrigado  G07     II   2.57
## 67     67 irrigado  G08     IV  20.29
## 68     68   sequia  G05     IV   9.75
## 69     69 irrigado  G04      I  14.70
## 70     70 irrigado  G11      V  19.16
## 71     71 irrigado  G12      I  19.18
## 72     72   sequia  G14     IV  18.43
## 73     73   sequia  G07    III   3.35
## 74     74 irrigado  G03    III  11.28
## 75     75   sequia  G01      I  10.37
## 76     76   sequia  G04      I  13.55
## 77     77   sequia  G03     II   9.50
## 78     78 irrigado  G15     II  16.68
## 79     79   sequia  G12     IV  12.61
## 80     80   sequia  G12      I  13.16
## 81     81   sequia  G08      I   7.69
## 82     82   sequia  G05     II  11.26
## 83     83   sequia  G02     II   9.51
## 84     84   sequia  G10      I   9.00
## 85     85   sequia  G15      I  11.22
## 86     86 irrigado  G07      V   2.36
## 87     87   sequia  G10      V   8.11
## 88     88   sequia  G13     II  13.03
## 89     89   sequia  G07      V   4.02
## 90     90   sequia  G03    III  10.03
## 91     91   sequia  G15     IV  12.08
## 92     92   sequia  G13      I  16.20
## 93     93   sequia  G03     IV  10.17
## 94     94 irrigado  G10      V  10.54
## 95     95   sequia  G13      V  15.03
## 96     96   sequia  G09     II  18.03
## 97     97 irrigado  G14     IV  24.48
## 98     98 irrigado  G01      V  14.29
## 99     99   sequia  G01    III  15.05
## 100   100 irrigado  G06     IV  26.84
## 101   101   sequia  G04     IV  11.68
## 102   102 irrigado  G15      V  18.73
## 103   103 irrigado  G13    III  24.04
## 104   104 irrigado  G02     II  15.66
## 105   105   sequia  G08     II  12.76
## 106   106 irrigado  G04    III  19.78
## 107   107   sequia  G02      V   9.81
## 108   108   sequia  G06      V  14.81
## 109   109 irrigado  G15      I  18.08
## 110   110 irrigado  G13      V  22.58
## 111   111 irrigado  G05      V  16.34
## 112   112   sequia  G09    III  17.31
## 113   113   sequia  G09      V  15.06
## 114   114   sequia  G10     II   8.42
## 115   115 irrigado  G07     IV   5.99
## 116   116 irrigado  G05      I  16.82
## 117   117 irrigado  G02      I  11.16
## 118   118   sequia  G05    III  11.51
## 119   119 irrigado  G12     II  14.90
## 120   120   sequia  G15    III  10.73
## 121   121 irrigado  G13      I  21.38
## 122   122   sequia  G14     II  20.96
## 123   123   sequia  G12     II  14.70
## 124   124   sequia  G15     II  13.31
## 125   125 irrigado  G09      V  20.79
## 126   126   sequia  G06      I  17.62
## 127   127   sequia  G09     IV  15.52
## 128   128   sequia  G15      V  12.56
## 129   129 irrigado  G14      I  23.46
## 130   130   sequia  G06    III  14.82
## 131   131 irrigado  G01     IV  18.66
## 132   132 irrigado  G12    III  19.55
## 133   133   sequia  G12      V  11.42
## 134   134 irrigado  G12      V  20.24
## 135   135   sequia  G11      V   8.28
## 136   136 irrigado  G12     IV  18.97
## 137   137 irrigado  G09      I     NA
## 138   138   sequia  G02    III  10.35
## 139   139   sequia  G07      I   3.37
## 140   140 irrigado  G08    III  16.92
## 141   141 irrigado  G06      I  21.92
## 142   142 irrigado  G10     IV   8.94
## 143   143 irrigado  G03      V  13.78
## 144   144   sequia  G07     IV   2.26
## 145   145 irrigado  G05    III  19.75
## 146   146   sequia  G14      I  14.33
## 147   147   sequia  G10    III  10.68
## 148   148 irrigado  G14     II  22.04
## 149   149 irrigado  G05     II  19.67
## 150   150   sequia  G10     IV   7.84
## 
## 
## $outliers
##     index    riego geno bloque leafdw       resi   res_MAD
## 22     22 irrigado  G14    III  10.07 -11.439057 -7.238226
## 33     33 irrigado  G14      V  27.58   6.070176  3.840990
## 137   137 irrigado  G09      I  14.07  -7.118542 -4.504358
##               rawp.BHStud                  adjp              bholm out_flag
## 22  0.0000000000004545253 0.0000000000004545253 0.0000000000681788  OUTLIER
## 33  0.0001225391185257774 0.0001225391185257774 0.0181357895418151  OUTLIER
## 137 0.0000066573810091342 0.0000066573810091342 0.0009919497703610  OUTLIER
## 
## $diagplot

## 
## $model
## $model$raw
## Linear mixed model fit by REML ['lmerMod']
## Formula: leafdw ~ riego * geno + (1 | bloque)
##    Data: rawdt
## REML criterion at convergence: 594.762
## Random effects:
##  Groups   Name        Std.Dev.
##  bloque   (Intercept) 0.1827  
##  Residual             2.3520  
## Number of obs: 150, groups:  bloque, 5
## Fixed Effects:
##         (Intercept)          riegosequia              genoG02  
##              16.924               -4.136               -1.812  
##             genoG03              genoG04              genoG05  
##              -2.982                2.440                1.568  
##             genoG06              genoG07              genoG08  
##               6.464              -13.534                1.526  
##             genoG09              genoG10              genoG11  
##               4.364               -5.268                0.936  
##             genoG12              genoG13              genoG14  
##               1.644                6.022                4.602  
##             genoG15  riegosequia:genoG02  riegosequia:genoG03  
##              -0.592               -1.390                0.322  
## riegosequia:genoG04  riegosequia:genoG05  riegosequia:genoG06  
##              -2.408               -2.746               -2.586  
## riegosequia:genoG07  riegosequia:genoG08  riegosequia:genoG09  
##               4.194               -2.736               -1.100  
## riegosequia:genoG10  riegosequia:genoG11  riegosequia:genoG12  
##               1.290               -3.818               -1.698  
## riegosequia:genoG13  riegosequia:genoG14  riegosequia:genoG15  
##              -4.800               -0.238               -0.216  
## 
## $model$clean
## Linear mixed model fit by REML ['lmerMod']
## Formula: leafdw ~ riego * geno + (1 | bloque)
##    Data: cleandt
## REML criterion at convergence: 530.3036
## Random effects:
##  Groups   Name        Std.Dev.
##  bloque   (Intercept) 0.2176  
##  Residual             1.8937  
## Number of obs: 147, groups:  bloque, 5
## Fixed Effects:
##         (Intercept)          riegosequia              genoG02  
##              16.924               -4.136               -1.812  
##             genoG03              genoG04              genoG05  
##              -2.982                2.440                1.568  
##             genoG06              genoG07              genoG08  
##               6.464              -13.534                1.526  
##             genoG09              genoG10              genoG11  
##               6.135               -5.268                0.936  
##             genoG12              genoG13              genoG14  
##               1.644                6.022                6.388  
##             genoG15  riegosequia:genoG02  riegosequia:genoG03  
##              -0.592               -1.390                0.322  
## riegosequia:genoG04  riegosequia:genoG05  riegosequia:genoG06  
##              -2.408               -2.746               -2.586  
## riegosequia:genoG07  riegosequia:genoG08  riegosequia:genoG09  
##               4.194               -2.736               -2.871  
## riegosequia:genoG10  riegosequia:genoG11  riegosequia:genoG12  
##               1.290               -3.818               -1.698  
## riegosequia:genoG13  riegosequia:genoG14  riegosequia:genoG15  
##              -4.800               -2.024               -0.216

Comparación de medias

library(agricolae)
library(tidyverse)
tukey_interaccion <- HSD.test(modelo, c("riego","geno"), group = TRUE)
print(tukey_interaccion)
## $statistics
##    MSerror  Df     Mean       CV      MSD
##   5.532101 116 14.61687 16.09129 5.720223
## 
## $parameters
##    test     name.t ntr StudentizedRange alpha
##   Tukey riego:geno  30         5.438172  0.05
## 
## $means
##              leafdw       std r       se   Min   Max   Q25   Q50   Q75
## irrigado:G01 16.924 2.0971957 5 1.051865 14.29 18.66 15.01 18.22 18.44
## irrigado:G02 15.112 2.4219558 5 1.051865 11.16 17.71 15.03 15.66 16.00
## irrigado:G03 13.942 1.8463938 5 1.051865 11.28 16.41 13.69 13.78 14.55
## irrigado:G04 19.364 2.7887865 5 1.051865 14.70 22.19 19.77 19.78 20.38
## irrigado:G05 18.492 1.7552407 5 1.051865 16.34 19.88 16.82 19.67 19.75
## irrigado:G06 23.388 2.0318883 5 1.051865 21.90 26.84 21.92 22.91 23.37
## irrigado:G07  3.390 1.6366887 5 1.051865  2.03  5.99  2.36  2.57  4.00
## irrigado:G08 18.450 1.2409875 5 1.051865 16.92 20.29 17.83 18.58 18.63
## irrigado:G09 21.288 4.3975527 5 1.051865 14.07 25.08 20.79 22.04 24.46
## irrigado:G10 11.656 2.8259299 5 1.051865  8.94 16.20 10.20 10.54 12.40
## irrigado:G11 17.860 3.2170173 5 1.051865 12.48 21.08 18.18 18.40 19.16
## irrigado:G12 18.568 2.1065541 5 1.051865 14.90 20.24 18.97 19.18 19.55
## irrigado:G13 22.946 1.0621582 5 1.051865 21.38 24.04 22.58 22.93 23.80
## irrigado:G14 21.526 6.7197753 5 1.051865 10.07 27.58 22.04 23.46 24.48
## irrigado:G15 16.332 2.3935894 5 1.051865 12.69 18.73 15.48 16.68 18.08
## sequia:G01   12.788 1.9627201 5 1.051865 10.37 15.05 11.18 13.28 14.06
## sequia:G02    9.586 0.5531094 5 1.051865  8.84 10.35  9.42  9.51  9.81
## sequia:G03   10.128 0.4218649 5 1.051865  9.50 10.66 10.03 10.17 10.28
## sequia:G04   12.820 1.2674581 5 1.051865 11.25 14.10 11.68 13.52 13.55
## sequia:G05   11.610 1.2971700 5 1.051865  9.75 13.25 11.26 11.51 12.28
## sequia:G06   16.666 2.1437887 5 1.051865 14.81 19.89 14.82 16.19 17.62
## sequia:G07    3.448 0.7716022 5 1.051865  2.26  4.24  3.35  3.37  4.02
## sequia:G08   11.578 2.4044272 5 1.051865  7.69 14.07 11.25 12.12 12.76
## sequia:G09   16.052 1.5566856 5 1.051865 14.34 18.03 15.06 15.52 17.31
## sequia:G10    8.810 1.1309288 5 1.051865  7.84 10.68  8.11  8.42  9.00
## sequia:G11    9.906 2.1905661 5 1.051865  7.26 12.85  8.28 10.56 10.58
## sequia:G12   12.734 1.2940943 5 1.051865 11.42 14.70 11.78 12.61 13.16
## sequia:G13   14.010 1.8583191 5 1.051865 11.39 16.20 13.03 14.40 15.03
## sequia:G14   17.152 2.5828705 5 1.051865 14.33 20.96 15.91 16.13 18.43
## sequia:G15   11.980 1.0314310 5 1.051865 10.73 13.31 11.22 12.08 12.56
## 
## $comparison
## NULL
## 
## $groups
##              leafdw groups
## irrigado:G06 23.388      a
## irrigado:G13 22.946      a
## irrigado:G14 21.526     ab
## irrigado:G09 21.288     ab
## irrigado:G04 19.364    abc
## irrigado:G12 18.568    abc
## irrigado:G05 18.492   abcd
## irrigado:G08 18.450  abcde
## irrigado:G11 17.860  abcde
## sequia:G14   17.152  bcdef
## irrigado:G01 16.924  bcdef
## sequia:G06   16.666  bcdef
## irrigado:G15 16.332  bcdef
## sequia:G09   16.052  bcdef
## irrigado:G02 15.112  cdefg
## sequia:G13   14.010 cdefgh
## irrigado:G03 13.942 cdefgh
## sequia:G04   12.820  defgh
## sequia:G01   12.788  defgh
## sequia:G12   12.734   efgh
## sequia:G15   11.980    fgh
## irrigado:G10 11.656    fgh
## sequia:G05   11.610    fgh
## sequia:G08   11.578    fgh
## sequia:G03   10.128     gh
## sequia:G11    9.906     gh
## sequia:G02    9.586     gh
## sequia:G10    8.810     hi
## sequia:G07    3.448      i
## irrigado:G07  3.390      i
## 
## attr(,"class")
## [1] "group"
plot(tukey_interaccion)


str(tukey_interaccion)
## List of 5
##  $ statistics:'data.frame':  1 obs. of  5 variables:
##   ..$ MSerror: num 5.53
##   ..$ Df     : int 116
##   ..$ Mean   : num 14.6
##   ..$ CV     : num 16.1
##   ..$ MSD    : num 5.72
##  $ parameters:'data.frame':  1 obs. of  5 variables:
##   ..$ test            : chr "Tukey"
##   ..$ name.t          : chr "riego:geno"
##   ..$ ntr             : int 30
##   ..$ StudentizedRange: num 5.44
##   ..$ alpha           : num 0.05
##  $ means     :'data.frame':  30 obs. of  9 variables:
##   ..$ leafdw: num [1:30] 16.9 15.1 13.9 19.4 18.5 ...
##   ..$ std   : num [1:30] 2.1 2.42 1.85 2.79 1.76 ...
##   ..$ r     : int [1:30] 5 5 5 5 5 5 5 5 5 5 ...
##   ..$ se    : num [1:30] 1.05 1.05 1.05 1.05 1.05 ...
##   ..$ Min   : num [1:30] 14.3 11.2 11.3 14.7 16.3 ...
##   ..$ Max   : num [1:30] 18.7 17.7 16.4 22.2 19.9 ...
##   ..$ Q25   : num [1:30] 15 15 13.7 19.8 16.8 ...
##   ..$ Q50   : num [1:30] 18.2 15.7 13.8 19.8 19.7 ...
##   ..$ Q75   : num [1:30] 18.4 16 14.6 20.4 19.8 ...
##  $ comparison: NULL
##  $ groups    :'data.frame':  30 obs. of  2 variables:
##   ..$ leafdw: num [1:30] 23.4 22.9 21.5 21.3 19.4 ...
##   ..$ groups: chr [1:30] "a" "a" "ab" "ab" ...
##  - attr(*, "class")= chr "group"

grupos <- tukey_interaccion$groups %>% 
  rownames_to_column("Tratamientos") %>% 
  separate("Tratamientos", into = c("riego","geno"))

str(grupos)
## 'data.frame':    30 obs. of  4 variables:
##  $ riego : chr  "irrigado" "irrigado" "irrigado" "irrigado" ...
##  $ geno  : chr  "G06" "G13" "G14" "G09" ...
##  $ leafdw: num  23.4 22.9 21.5 21.3 19.4 ...
##  $ groups: chr  "a" "a" "ab" "ab" ...
ggplot(grupos, aes(x = geno, y = leafdw, fill = riego)) +
  geom_bar(stat = "identity", position = position_dodge()) +
  geom_text(aes(label = groups), 
            position = position_dodge(width = 0.9), 
            vjust = -0.3, 
            size = 3) +  
  labs(title = "Efecto de Geno y Riego en LEAFDW",
       x = "Genotipo",
       y = "LEAFDW") +
  theme_minimal() +
  scale_fill_discrete(name = "Riego") +
  theme(axis.text.x = element_text(angle = 45, hjust = 1))

6.2 Peso seco de la raíz (g)

6.2.1 Modelo lineal de rootdw

ANOVA

modelo <- aov(formula = rootdw ~  bloque + riego + geno + riego*geno
          , data = fb)

anova(modelo)
## Analysis of Variance Table
## 
## Response: rootdw
##             Df Sum Sq Mean Sq F value              Pr(>F)    
## bloque       4   4.93   1.232  1.5303              0.1979    
## riego        1   1.12   1.120  1.3903              0.2408    
## geno        14 456.29  32.592 40.4686 <0.0000000000000002 ***
## riego:geno  14   7.79   0.556  0.6908              0.7794    
## Residuals  116  93.42   0.805                                
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Prueba de normalidad

plot(modelo)

Interacción de niveles de riego y Geno

library(ggplot2)
ggplot(fb, aes(x = geno, y = rootdw, colour = riego)) +
  geom_boxplot(outlier.colour = "red", outlier.shape = 16, outlier.size = 2) +
  labs(title = "Boxplot con interacción de niveles de riego y genotipo",
       x = "Interacción Riego y Genotipo",
       y = "Peso seco de la raíz (g)")

  theme_minimal() +
  theme(axis.text.x = element_text(angle = 45, hjust = 1))  # Inclinar etiquetas del eje X
## List of 136
##  $ line                            :List of 6
##   ..$ colour       : chr "black"
##   ..$ linewidth    : num 0.5
##   ..$ linetype     : num 1
##   ..$ lineend      : chr "butt"
##   ..$ arrow        : logi FALSE
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_line" "element"
##  $ rect                            :List of 5
##   ..$ fill         : chr "white"
##   ..$ colour       : chr "black"
##   ..$ linewidth    : num 0.5
##   ..$ linetype     : num 1
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_rect" "element"
##  $ text                            :List of 11
##   ..$ family       : chr ""
##   ..$ face         : chr "plain"
##   ..$ colour       : chr "black"
##   ..$ size         : num 11
##   ..$ hjust        : num 0.5
##   ..$ vjust        : num 0.5
##   ..$ angle        : num 0
##   ..$ lineheight   : num 0.9
##   ..$ margin       : 'margin' num [1:4] 0points 0points 0points 0points
##   .. ..- attr(*, "unit")= int 8
##   ..$ debug        : logi FALSE
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ title                           : NULL
##  $ aspect.ratio                    : NULL
##  $ axis.title                      : NULL
##  $ axis.title.x                    :List of 11
##   ..$ family       : NULL
##   ..$ face         : NULL
##   ..$ colour       : NULL
##   ..$ size         : NULL
##   ..$ hjust        : NULL
##   ..$ vjust        : num 1
##   ..$ angle        : NULL
##   ..$ lineheight   : NULL
##   ..$ margin       : 'margin' num [1:4] 2.75points 0points 0points 0points
##   .. ..- attr(*, "unit")= int 8
##   ..$ debug        : NULL
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ axis.title.x.top                :List of 11
##   ..$ family       : NULL
##   ..$ face         : NULL
##   ..$ colour       : NULL
##   ..$ size         : NULL
##   ..$ hjust        : NULL
##   ..$ vjust        : num 0
##   ..$ angle        : NULL
##   ..$ lineheight   : NULL
##   ..$ margin       : 'margin' num [1:4] 0points 0points 2.75points 0points
##   .. ..- attr(*, "unit")= int 8
##   ..$ debug        : NULL
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ axis.title.x.bottom             : NULL
##  $ axis.title.y                    :List of 11
##   ..$ family       : NULL
##   ..$ face         : NULL
##   ..$ colour       : NULL
##   ..$ size         : NULL
##   ..$ hjust        : NULL
##   ..$ vjust        : num 1
##   ..$ angle        : num 90
##   ..$ lineheight   : NULL
##   ..$ margin       : 'margin' num [1:4] 0points 2.75points 0points 0points
##   .. ..- attr(*, "unit")= int 8
##   ..$ debug        : NULL
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ axis.title.y.left               : NULL
##  $ axis.title.y.right              :List of 11
##   ..$ family       : NULL
##   ..$ face         : NULL
##   ..$ colour       : NULL
##   ..$ size         : NULL
##   ..$ hjust        : NULL
##   ..$ vjust        : num 1
##   ..$ angle        : num -90
##   ..$ lineheight   : NULL
##   ..$ margin       : 'margin' num [1:4] 0points 0points 0points 2.75points
##   .. ..- attr(*, "unit")= int 8
##   ..$ debug        : NULL
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ axis.text                       :List of 11
##   ..$ family       : NULL
##   ..$ face         : NULL
##   ..$ colour       : chr "grey30"
##   ..$ size         : 'rel' num 0.8
##   ..$ hjust        : NULL
##   ..$ vjust        : NULL
##   ..$ angle        : NULL
##   ..$ lineheight   : NULL
##   ..$ margin       : NULL
##   ..$ debug        : NULL
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ axis.text.x                     :List of 11
##   ..$ family       : NULL
##   ..$ face         : NULL
##   ..$ colour       : NULL
##   ..$ size         : NULL
##   ..$ hjust        : num 1
##   ..$ vjust        : num 1
##   ..$ angle        : num 45
##   ..$ lineheight   : NULL
##   ..$ margin       : 'margin' num [1:4] 2.2points 0points 0points 0points
##   .. ..- attr(*, "unit")= int 8
##   ..$ debug        : NULL
##   ..$ inherit.blank: logi FALSE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ axis.text.x.top                 :List of 11
##   ..$ family       : NULL
##   ..$ face         : NULL
##   ..$ colour       : NULL
##   ..$ size         : NULL
##   ..$ hjust        : NULL
##   ..$ vjust        : num 0
##   ..$ angle        : NULL
##   ..$ lineheight   : NULL
##   ..$ margin       : 'margin' num [1:4] 0points 0points 2.2points 0points
##   .. ..- attr(*, "unit")= int 8
##   ..$ debug        : NULL
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ axis.text.x.bottom              : NULL
##  $ axis.text.y                     :List of 11
##   ..$ family       : NULL
##   ..$ face         : NULL
##   ..$ colour       : NULL
##   ..$ size         : NULL
##   ..$ hjust        : num 1
##   ..$ vjust        : NULL
##   ..$ angle        : NULL
##   ..$ lineheight   : NULL
##   ..$ margin       : 'margin' num [1:4] 0points 2.2points 0points 0points
##   .. ..- attr(*, "unit")= int 8
##   ..$ debug        : NULL
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ axis.text.y.left                : NULL
##  $ axis.text.y.right               :List of 11
##   ..$ family       : NULL
##   ..$ face         : NULL
##   ..$ colour       : NULL
##   ..$ size         : NULL
##   ..$ hjust        : num 0
##   ..$ vjust        : NULL
##   ..$ angle        : NULL
##   ..$ lineheight   : NULL
##   ..$ margin       : 'margin' num [1:4] 0points 0points 0points 2.2points
##   .. ..- attr(*, "unit")= int 8
##   ..$ debug        : NULL
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ axis.text.theta                 : NULL
##  $ axis.text.r                     :List of 11
##   ..$ family       : NULL
##   ..$ face         : NULL
##   ..$ colour       : NULL
##   ..$ size         : NULL
##   ..$ hjust        : num 0.5
##   ..$ vjust        : NULL
##   ..$ angle        : NULL
##   ..$ lineheight   : NULL
##   ..$ margin       : 'margin' num [1:4] 0points 2.2points 0points 2.2points
##   .. ..- attr(*, "unit")= int 8
##   ..$ debug        : NULL
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ axis.ticks                      : list()
##   ..- attr(*, "class")= chr [1:2] "element_blank" "element"
##  $ axis.ticks.x                    : NULL
##  $ axis.ticks.x.top                : NULL
##  $ axis.ticks.x.bottom             : NULL
##  $ axis.ticks.y                    : NULL
##  $ axis.ticks.y.left               : NULL
##  $ axis.ticks.y.right              : NULL
##  $ axis.ticks.theta                : NULL
##  $ axis.ticks.r                    : NULL
##  $ axis.minor.ticks.x.top          : NULL
##  $ axis.minor.ticks.x.bottom       : NULL
##  $ axis.minor.ticks.y.left         : NULL
##  $ axis.minor.ticks.y.right        : NULL
##  $ axis.minor.ticks.theta          : NULL
##  $ axis.minor.ticks.r              : NULL
##  $ axis.ticks.length               : 'simpleUnit' num 2.75points
##   ..- attr(*, "unit")= int 8
##  $ axis.ticks.length.x             : NULL
##  $ axis.ticks.length.x.top         : NULL
##  $ axis.ticks.length.x.bottom      : NULL
##  $ axis.ticks.length.y             : NULL
##  $ axis.ticks.length.y.left        : NULL
##  $ axis.ticks.length.y.right       : NULL
##  $ axis.ticks.length.theta         : NULL
##  $ axis.ticks.length.r             : NULL
##  $ axis.minor.ticks.length         : 'rel' num 0.75
##  $ axis.minor.ticks.length.x       : NULL
##  $ axis.minor.ticks.length.x.top   : NULL
##  $ axis.minor.ticks.length.x.bottom: NULL
##  $ axis.minor.ticks.length.y       : NULL
##  $ axis.minor.ticks.length.y.left  : NULL
##  $ axis.minor.ticks.length.y.right : NULL
##  $ axis.minor.ticks.length.theta   : NULL
##  $ axis.minor.ticks.length.r       : NULL
##  $ axis.line                       : list()
##   ..- attr(*, "class")= chr [1:2] "element_blank" "element"
##  $ axis.line.x                     : NULL
##  $ axis.line.x.top                 : NULL
##  $ axis.line.x.bottom              : NULL
##  $ axis.line.y                     : NULL
##  $ axis.line.y.left                : NULL
##  $ axis.line.y.right               : NULL
##  $ axis.line.theta                 : NULL
##  $ axis.line.r                     : NULL
##  $ legend.background               : list()
##   ..- attr(*, "class")= chr [1:2] "element_blank" "element"
##  $ legend.margin                   : 'margin' num [1:4] 5.5points 5.5points 5.5points 5.5points
##   ..- attr(*, "unit")= int 8
##  $ legend.spacing                  : 'simpleUnit' num 11points
##   ..- attr(*, "unit")= int 8
##  $ legend.spacing.x                : NULL
##  $ legend.spacing.y                : NULL
##  $ legend.key                      : list()
##   ..- attr(*, "class")= chr [1:2] "element_blank" "element"
##  $ legend.key.size                 : 'simpleUnit' num 1.2lines
##   ..- attr(*, "unit")= int 3
##  $ legend.key.height               : NULL
##  $ legend.key.width                : NULL
##  $ legend.key.spacing              : 'simpleUnit' num 5.5points
##   ..- attr(*, "unit")= int 8
##  $ legend.key.spacing.x            : NULL
##  $ legend.key.spacing.y            : NULL
##  $ legend.frame                    : NULL
##  $ legend.ticks                    : NULL
##  $ legend.ticks.length             : 'rel' num 0.2
##  $ legend.axis.line                : NULL
##  $ legend.text                     :List of 11
##   ..$ family       : NULL
##   ..$ face         : NULL
##   ..$ colour       : NULL
##   ..$ size         : 'rel' num 0.8
##   ..$ hjust        : NULL
##   ..$ vjust        : NULL
##   ..$ angle        : NULL
##   ..$ lineheight   : NULL
##   ..$ margin       : NULL
##   ..$ debug        : NULL
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ legend.text.position            : NULL
##  $ legend.title                    :List of 11
##   ..$ family       : NULL
##   ..$ face         : NULL
##   ..$ colour       : NULL
##   ..$ size         : NULL
##   ..$ hjust        : num 0
##   ..$ vjust        : NULL
##   ..$ angle        : NULL
##   ..$ lineheight   : NULL
##   ..$ margin       : NULL
##   ..$ debug        : NULL
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ legend.title.position           : NULL
##  $ legend.position                 : chr "right"
##  $ legend.position.inside          : NULL
##  $ legend.direction                : NULL
##  $ legend.byrow                    : NULL
##  $ legend.justification            : chr "center"
##  $ legend.justification.top        : NULL
##  $ legend.justification.bottom     : NULL
##  $ legend.justification.left       : NULL
##  $ legend.justification.right      : NULL
##  $ legend.justification.inside     : NULL
##  $ legend.location                 : NULL
##  $ legend.box                      : NULL
##  $ legend.box.just                 : NULL
##  $ legend.box.margin               : 'margin' num [1:4] 0cm 0cm 0cm 0cm
##   ..- attr(*, "unit")= int 1
##  $ legend.box.background           : list()
##   ..- attr(*, "class")= chr [1:2] "element_blank" "element"
##  $ legend.box.spacing              : 'simpleUnit' num 11points
##   ..- attr(*, "unit")= int 8
##   [list output truncated]
##  - attr(*, "class")= chr [1:2] "theme" "gg"
##  - attr(*, "complete")= logi TRUE
##  - attr(*, "validate")= logi TRUE

6.2.2 Modelo lineal mixto

library(lme4)

library(lmerTest)

model <- lme4::lmer(formula = rootdw ~ riego * geno + (1|bloque), data = fb)
anova(model)
## Analysis of Variance Table
##            npar Sum Sq Mean Sq F value
## riego         1   1.12   1.120  1.3903
## geno         14 456.29  32.592 40.4686
## riego:geno   14   7.79   0.556  0.6908

Prueba de normalida

plot(modelo)

Eliminación de datos atípicos

ol <- boxplot(rootdw ~ riego * geno, fb)


ol
## $stats
##      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13] [,14]
## [1,] 1.70 2.45 1.75 2.00 1.45 1.21 1.59 0.52 2.07  2.19  3.97  4.04  0.38  0.42
## [2,] 2.28 2.98 1.81 2.04 1.61 1.60 2.58 1.85 2.24  2.60  4.02  4.46  0.49  0.43
## [3,] 3.01 3.11 2.37 2.10 1.66 1.78 2.83 1.96 3.26  3.88  4.82  4.64  0.66  0.65
## [4,] 3.16 3.83 2.48 2.13 1.83 3.36 3.24 2.85 3.65  4.17  6.63  5.18  1.09  1.39
## [5,] 3.47 3.83 2.50 2.13 1.83 3.50 3.44 3.68 4.18  4.42  8.33  5.57  1.21  1.52
##      [,15] [,16] [,17] [,18] [,19] [,20] [,21] [,22] [,23] [,24] [,25] [,26]
## [1,]  6.27  5.44  2.82  2.69  0.80  1.89  1.96  1.85  4.62  4.06  4.69  4.98
## [2,]  6.27  5.47  2.85  3.14  1.02  1.89  2.11  2.06  5.03  4.65  4.73  5.05
## [3,]  6.40  6.12  2.99  3.54  1.55  1.92  2.60  2.29  5.35  5.48  5.01  6.00
## [4,]  6.45  6.95  3.29  3.71  1.72  2.04  2.75  2.66  6.24  6.17  6.44  6.17
## [5,]  6.45  8.50  3.54  4.25  2.42  2.18  3.35  2.69  7.36  6.47  6.89  6.17
##      [,27] [,28] [,29] [,30]
## [1,]  4.56  5.33  2.48  2.40
## [2,]  5.68  5.77  2.48  2.76
## [3,]  6.61  5.92  2.82  2.78
## [4,]  6.87  7.24  2.88  3.93
## [5,]  7.23  7.67  3.03  4.29
## 
## $n
##  [1] 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5
## 
## $conf
##          [,1]     [,2]    [,3]     [,4]     [,5]      [,6]     [,7]     [,8]
## [1,] 2.388194 2.509392 1.89658 2.036406 1.504549 0.5363884 2.363646 1.253403
## [2,] 3.631806 3.710608 2.84342 2.163594 1.815451 3.0236116 3.296354 2.666597
##          [,9]    [,10]    [,11]   [,12]     [,13]       [,14]    [,15]    [,16]
## [1,] 2.263698 2.770642 2.975781 4.13125 0.2360415 -0.02833358 6.272812 5.074236
## [2,] 4.256302 4.989358 6.664219 5.14875 1.0839585  1.32833358 6.527188 7.165764
##         [,17]    [,18]    [,19]   [,20]    [,21]    [,22]    [,23]    [,24]
## [1,] 2.679097 3.137239 1.055382 1.81401 2.147778 1.866042 4.495017 4.405972
## [2,] 3.300903 3.942761 2.044618 2.02599 3.052222 2.713958 6.204983 6.554028
##         [,25]    [,26]    [,27]    [,28]    [,29]    [,30]
## [1,] 3.801718 5.208611 5.769149 4.881302 2.537361 1.953281
## [2,] 6.218282 6.791389 7.450851 6.958698 3.102639 3.606719
## 
## $out
## [1] 5.73 4.15 2.30 7.33 5.56 1.50 8.75 1.83
## 
## $group
## [1]  2  4  5 15 15 20 26 29
## 
## $names
##  [1] "irrigado.G01" "sequia.G01"   "irrigado.G02" "sequia.G02"   "irrigado.G03"
##  [6] "sequia.G03"   "irrigado.G04" "sequia.G04"   "irrigado.G05" "sequia.G05"  
## [11] "irrigado.G06" "sequia.G06"   "irrigado.G07" "sequia.G07"   "irrigado.G08"
## [16] "sequia.G08"   "irrigado.G09" "sequia.G09"   "irrigado.G10" "sequia.G10"  
## [21] "irrigado.G11" "sequia.G11"   "irrigado.G12" "sequia.G12"   "irrigado.G13"
## [26] "sequia.G13"   "irrigado.G14" "sequia.G14"   "irrigado.G15" "sequia.G15"
library(inti)

model <- remove_outliers(data = fb
                             , formula = rootdw ~ riego * geno + (1|bloque)
                         , plot_diag = T)
model
## $data
## $data$raw
## # A tibble: 150 × 5
##    index riego    geno  bloque rootdw
##    <chr> <chr>    <chr> <chr>   <dbl>
##  1 1     sequia   G01   II       3.83
##  2 2     sequia   G02   IV       2.1 
##  3 3     irrigado G01   III      3.16
##  4 4     sequia   G02   I        2   
##  5 5     irrigado G03   II       1.83
##  6 6     irrigado G04   V        2.83
##  7 7     irrigado G01   I        2.28
##  8 8     irrigado G05   IV       3.65
##  9 9     sequia   G06   II       4.04
## 10 10    sequia   G05   I        4.17
## # ℹ 140 more rows
## 
## $data$clean
##     index    riego geno bloque rootdw
## 1       1   sequia  G01     II   3.83
## 2       2   sequia  G02     IV   2.10
## 3       3 irrigado  G01    III   3.16
## 4       4   sequia  G02      I   2.00
## 5       5 irrigado  G03     II   1.83
## 6       6 irrigado  G04      V   2.83
## 7       7 irrigado  G01      I   2.28
## 8       8 irrigado  G05     IV   3.65
## 9       9   sequia  G06     II   4.04
## 10     10   sequia  G05      I   4.17
## 11     11 irrigado  G01     II   3.01
## 12     12   sequia  G07     II   1.52
## 13     13 irrigado  G08     II   6.45
## 14     14 irrigado  G06    III   6.63
## 15     15 irrigado  G09    III   2.82
## 16     16 irrigado  G10     II   1.02
## 17     17   sequia  G11      I   2.69
## 18     18   sequia  G12    III   5.48
## 19     19 irrigado  G07      I   0.49
## 20     20 irrigado  G04     II   3.44
## 21     21 irrigado  G13     II   5.01
## 22     22 irrigado  G14    III   4.56
## 23     23 irrigado  G04     IV   3.24
## 24     24   sequia  G04      V   1.85
## 25     25   sequia  G08      V   5.47
## 26     26   sequia  G04    III   3.68
## 27     27   sequia  G01     IV   3.11
## 28     28 irrigado  G10      I   1.55
## 29     29 irrigado  G08      V   6.27
## 30     30 irrigado  G02      V   2.37
## 31     31 irrigado  G07    III   1.09
## 32     32 irrigado  G08      I   6.40
## 33     33 irrigado  G14      V   7.23
## 34     34 irrigado  G03      I   1.45
## 35     35   sequia  G13    III   5.05
## 36     36   sequia  G01      V   2.98
## 37     37   sequia  G03      I   3.50
## 38     38 irrigado  G15    III   2.88
## 39     39 irrigado  G03     IV   2.30
## 40     40 irrigado  G09     IV   3.29
## 41     41 irrigado  G11     II   1.96
## 42     42   sequia  G03      V   1.60
## 43     43   sequia  G11    III   2.66
## 44     44 irrigado  G06      V   3.97
## 45     45   sequia  G05      V   3.88
## 46     46   sequia  G08     IV   6.12
## 47     47 irrigado  G11     IV   3.35
## 48     48   sequia  G11     II   1.85
## 49     49 irrigado  G10    III   2.42
## 50     50   sequia  G06     IV   4.64
## 51     51   sequia  G09      I   4.25
## 52     52 irrigado  G11      I   2.11
## 53     53   sequia  G11     IV   2.29
## 54     54 irrigado  G15     IV   1.83
## 55     55 irrigado  G13     IV   6.44
## 56     56   sequia  G14      V   5.77
## 57     57 irrigado  G02     IV   2.48
## 58     58 irrigado  G09     II   3.54
## 59     59 irrigado  G02    III   1.81
## 60     60   sequia  G08    III   8.50
## 61     61 irrigado  G06     II   4.02
## 62     62   sequia  G13     IV   4.98
## 63     63   sequia  G14    III   7.24
## 64     64   sequia  G04     II   0.52
## 65     65 irrigado  G11    III   2.60
## 66     66 irrigado  G07     II   0.38
## 67     67 irrigado  G08     IV   7.33
## 68     68   sequia  G05     IV   2.60
## 69     69 irrigado  G04      I   1.59
## 70     70 irrigado  G11      V   2.75
## 71     71 irrigado  G12      I   4.62
## 72     72   sequia  G14     IV   5.92
## 73     73   sequia  G07    III   1.39
## 74     74 irrigado  G03    III   1.61
## 75     75   sequia  G01      I   2.45
## 76     76   sequia  G04      I   2.85
## 77     77   sequia  G03     II   3.36
## 78     78 irrigado  G15     II   2.48
## 79     79   sequia  G12     IV   4.06
## 80     80   sequia  G12      I   6.17
## 81     81   sequia  G08      I   5.44
## 82     82   sequia  G05     II   2.19
## 83     83   sequia  G02     II   2.13
## 84     84   sequia  G10      I   2.04
## 85     85   sequia  G15      I   2.40
## 86     86 irrigado  G07      V   0.66
## 87     87   sequia  G10      V   1.50
## 88     88   sequia  G13     II   6.17
## 89     89   sequia  G07      V   0.43
## 90     90   sequia  G03    III   1.21
## 91     91   sequia  G15     IV   2.78
## 92     92   sequia  G13      I   8.75
## 93     93   sequia  G03     IV   1.78
## 94     94 irrigado  G10      V   1.72
## 95     95   sequia  G13      V   6.00
## 96     96   sequia  G09     II   3.71
## 97     97 irrigado  G14     IV   6.87
## 98     98 irrigado  G01      V   1.70
## 99     99   sequia  G01    III   5.73
## 100   100 irrigado  G06     IV     NA
## 101   101   sequia  G04     IV   1.96
## 102   102 irrigado  G15      V   3.03
## 103   103 irrigado  G13    III   4.73
## 104   104 irrigado  G02     II   2.50
## 105   105   sequia  G08     II   6.95
## 106   106 irrigado  G04    III   2.58
## 107   107   sequia  G02      V   2.04
## 108   108   sequia  G06      V   4.46
## 109   109 irrigado  G15      I   2.82
## 110   110 irrigado  G13      V   6.89
## 111   111 irrigado  G05      V   2.24
## 112   112   sequia  G09    III   3.54
## 113   113   sequia  G09      V   2.69
## 114   114   sequia  G10     II   1.89
## 115   115 irrigado  G07     IV   1.21
## 116   116 irrigado  G05      I   2.07
## 117   117 irrigado  G02      I   1.75
## 118   118   sequia  G05    III   4.42
## 119   119 irrigado  G12     II   5.03
## 120   120   sequia  G15    III   3.93
## 121   121 irrigado  G13      I   4.69
## 122   122   sequia  G14     II   5.33
## 123   123   sequia  G12     II   6.47
## 124   124   sequia  G15     II   4.29
## 125   125 irrigado  G09      V   2.99
## 126   126   sequia  G06      I   5.57
## 127   127   sequia  G09     IV   3.14
## 128   128   sequia  G15      V   2.76
## 129   129 irrigado  G14      I   5.68
## 130   130   sequia  G06    III   5.18
## 131   131 irrigado  G01     IV   3.47
## 132   132 irrigado  G12    III   6.24
## 133   133   sequia  G12      V   4.65
## 134   134 irrigado  G12      V   5.35
## 135   135   sequia  G11      V   2.06
## 136   136 irrigado  G12     IV   7.36
## 137   137 irrigado  G09      I   2.85
## 138   138   sequia  G02    III   4.15
## 139   139   sequia  G07      I   0.65
## 140   140 irrigado  G08    III   5.56
## 141   141 irrigado  G06      I   4.82
## 142   142 irrigado  G10     IV   0.80
## 143   143 irrigado  G03      V   1.66
## 144   144   sequia  G07     IV   0.42
## 145   145 irrigado  G05    III   3.26
## 146   146   sequia  G14      I   7.67
## 147   147   sequia  G10    III   2.18
## 148   148 irrigado  G14     II   6.61
## 149   149 irrigado  G05     II   4.18
## 150   150   sequia  G10     IV   1.92
## 
## 
## $outliers
##     index    riego geno bloque rootdw     resi  res_MAD  rawp.BHStud
## 100   100 irrigado  G06     IV   8.33 2.749408 3.793167 0.0001487381
##             adjp      bholm out_flag
## 100 0.0001487381 0.02231072  OUTLIER
## 
## $diagplot

## 
## $model
## $model$raw
## Linear mixed model fit by REML ['lmerMod']
## Formula: rootdw ~ riego * geno + (1 | bloque)
##    Data: rawdt
## REML criterion at convergence: 364.5568
## Random effects:
##  Groups   Name        Std.Dev.
##  bloque   (Intercept) 0.1193  
##  Residual             0.8974  
## Number of obs: 150, groups:  bloque, 5
## Fixed Effects:
##         (Intercept)          riegosequia              genoG02  
##               2.724                0.896               -0.542  
##             genoG03              genoG04              genoG05  
##              -0.954                0.012                0.356  
##             genoG06              genoG07              genoG08  
##               2.830               -1.958                3.678  
##             genoG09              genoG10              genoG11  
##               0.374               -1.222               -0.170  
##             genoG12              genoG13              genoG14  
##               2.996                2.828                3.466  
##             genoG15  riegosequia:genoG02  riegosequia:genoG03  
##              -0.116               -0.594               -0.376  
## riegosequia:genoG04  riegosequia:genoG05  riegosequia:genoG06  
##              -1.460               -0.524               -1.672  
## riegosequia:genoG07  riegosequia:genoG08  riegosequia:genoG09  
##              -0.780               -0.802               -0.528  
## riegosequia:genoG10  riegosequia:genoG11  riegosequia:genoG12  
##              -0.492               -1.140               -1.250  
## riegosequia:genoG13  riegosequia:genoG14  riegosequia:genoG15  
##              -0.258               -0.700               -0.272  
## 
## $model$clean
## Linear mixed model fit by REML ['lmerMod']
## Formula: rootdw ~ riego * geno + (1 | bloque)
##    Data: cleandt
## REML criterion at convergence: 350.2952
## Random effects:
##  Groups   Name        Std.Dev.
##  bloque   (Intercept) 0.1232  
##  Residual             0.8546  
## Number of obs: 149, groups:  bloque, 5
## Fixed Effects:
##         (Intercept)          riegosequia              genoG02  
##              2.7240               0.8960              -0.5420  
##             genoG03              genoG04              genoG05  
##             -0.9540               0.0120               0.3560  
##             genoG06              genoG07              genoG08  
##              2.1345              -1.9580               3.6780  
##             genoG09              genoG10              genoG11  
##              0.3740              -1.2220              -0.1700  
##             genoG12              genoG13              genoG14  
##              2.9960               2.8280               3.4660  
##             genoG15  riegosequia:genoG02  riegosequia:genoG03  
##             -0.1160              -0.5940              -0.3760  
## riegosequia:genoG04  riegosequia:genoG05  riegosequia:genoG06  
##             -1.4600              -0.5240              -0.9765  
## riegosequia:genoG07  riegosequia:genoG08  riegosequia:genoG09  
##             -0.7800              -0.8020              -0.5280  
## riegosequia:genoG10  riegosequia:genoG11  riegosequia:genoG12  
##             -0.4920              -1.1400              -1.2500  
## riegosequia:genoG13  riegosequia:genoG14  riegosequia:genoG15  
##             -0.2580              -0.7000              -0.2720

Comparación de medias

library(agricolae)
library(tidyverse)
tukey_interaccion <- HSD.test(modelo, c("riego","geno"), group = TRUE)
print(tukey_interaccion)
## $statistics
##     MSerror  Df     Mean       CV      MSD
##   0.8053762 116 3.582267 25.05195 2.182566
## 
## $parameters
##    test     name.t ntr StudentizedRange alpha
##   Tukey riego:geno  30         5.438172  0.05
## 
## $means
##              rootdw       std r        se  Min  Max  Q25  Q50  Q75
## irrigado:G01  2.724 0.7200903 5 0.4013418 1.70 3.47 2.28 3.01 3.16
## irrigado:G02  2.182 0.3709043 5 0.4013418 1.75 2.50 1.81 2.37 2.48
## irrigado:G03  1.770 0.3258067 5 0.4013418 1.45 2.30 1.61 1.66 1.83
## irrigado:G04  2.736 0.7238992 5 0.4013418 1.59 3.44 2.58 2.83 3.24
## irrigado:G05  3.080 0.9073313 5 0.4013418 2.07 4.18 2.24 3.26 3.65
## irrigado:G06  5.554 1.8884465 5 0.4013418 3.97 8.33 4.02 4.82 6.63
## irrigado:G07  0.766 0.3669196 5 0.4013418 0.38 1.21 0.49 0.66 1.09
## irrigado:G08  6.402 0.6304522 5 0.4013418 5.56 7.33 6.27 6.40 6.45
## irrigado:G09  3.098 0.3093057 5 0.4013418 2.82 3.54 2.85 2.99 3.29
## irrigado:G10  1.502 0.6359402 5 0.4013418 0.80 2.42 1.02 1.55 1.72
## irrigado:G11  2.554 0.5531998 5 0.4013418 1.96 3.35 2.11 2.60 2.75
## irrigado:G12  5.720 1.0935035 5 0.4013418 4.62 7.36 5.03 5.35 6.24
## irrigado:G13  5.552 1.0357702 5 0.4013418 4.69 6.89 4.73 5.01 6.44
## irrigado:G14  6.190 1.0767312 5 0.4013418 4.56 7.23 5.68 6.61 6.87
## irrigado:G15  2.608 0.4792390 5 0.4013418 1.83 3.03 2.48 2.82 2.88
## sequia:G01    3.620 1.2781627 5 0.4013418 2.45 5.73 2.98 3.11 3.83
## sequia:G02    2.484 0.9327004 5 0.4013418 2.00 4.15 2.04 2.10 2.13
## sequia:G03    2.290 1.0620264 5 0.4013418 1.21 3.50 1.60 1.78 3.36
## sequia:G04    2.172 1.1844281 5 0.4013418 0.52 3.68 1.85 1.96 2.85
## sequia:G05    3.452 0.9942686 5 0.4013418 2.19 4.42 2.60 3.88 4.17
## sequia:G06    4.778 0.6028433 5 0.4013418 4.04 5.57 4.46 4.64 5.18
## sequia:G07    0.882 0.5330760 5 0.4013418 0.42 1.52 0.43 0.65 1.39
## sequia:G08    6.496 1.2778224 5 0.4013418 5.44 8.50 5.47 6.12 6.95
## sequia:G09    3.466 0.5890925 5 0.4013418 2.69 4.25 3.14 3.54 3.71
## sequia:G10    1.906 0.2541260 5 0.4013418 1.50 2.18 1.89 1.92 2.04
## sequia:G11    2.310 0.3678994 5 0.4013418 1.85 2.69 2.06 2.29 2.66
## sequia:G12    5.366 1.0119931 5 0.4013418 4.06 6.47 4.65 5.48 6.17
## sequia:G13    6.190 1.5291991 5 0.4013418 4.98 8.75 5.05 6.00 6.17
## sequia:G14    6.386 1.0111528 5 0.4013418 5.33 7.67 5.77 5.92 7.24
## sequia:G15    3.232 0.8255120 5 0.4013418 2.40 4.29 2.76 2.78 3.93
## 
## $comparison
## NULL
## 
## $groups
##              rootdw groups
## sequia:G08    6.496      a
## irrigado:G08  6.402      a
## sequia:G14    6.386      a
## irrigado:G14  6.190      a
## sequia:G13    6.190      a
## irrigado:G12  5.720     ab
## irrigado:G06  5.554    abc
## irrigado:G13  5.552    abc
## sequia:G12    5.366   abcd
## sequia:G06    4.778  abcde
## sequia:G01    3.620  bcdef
## sequia:G09    3.466   cdef
## sequia:G05    3.452   cdef
## sequia:G15    3.232    def
## irrigado:G09  3.098     ef
## irrigado:G05  3.080     ef
## irrigado:G04  2.736    efg
## irrigado:G01  2.724    efg
## irrigado:G15  2.608    efg
## irrigado:G11  2.554     fg
## sequia:G02    2.484     fg
## sequia:G11    2.310     fg
## sequia:G03    2.290     fg
## irrigado:G02  2.182     fg
## sequia:G04    2.172     fg
## sequia:G10    1.906     fg
## irrigado:G03  1.770     fg
## irrigado:G10  1.502     fg
## sequia:G07    0.882      g
## irrigado:G07  0.766      g
## 
## attr(,"class")
## [1] "group"
plot(tukey_interaccion)


str(tukey_interaccion)
## List of 5
##  $ statistics:'data.frame':  1 obs. of  5 variables:
##   ..$ MSerror: num 0.805
##   ..$ Df     : int 116
##   ..$ Mean   : num 3.58
##   ..$ CV     : num 25.1
##   ..$ MSD    : num 2.18
##  $ parameters:'data.frame':  1 obs. of  5 variables:
##   ..$ test            : chr "Tukey"
##   ..$ name.t          : chr "riego:geno"
##   ..$ ntr             : int 30
##   ..$ StudentizedRange: num 5.44
##   ..$ alpha           : num 0.05
##  $ means     :'data.frame':  30 obs. of  9 variables:
##   ..$ rootdw: num [1:30] 2.72 2.18 1.77 2.74 3.08 ...
##   ..$ std   : num [1:30] 0.72 0.371 0.326 0.724 0.907 ...
##   ..$ r     : int [1:30] 5 5 5 5 5 5 5 5 5 5 ...
##   ..$ se    : num [1:30] 0.401 0.401 0.401 0.401 0.401 ...
##   ..$ Min   : num [1:30] 1.7 1.75 1.45 1.59 2.07 3.97 0.38 5.56 2.82 0.8 ...
##   ..$ Max   : num [1:30] 3.47 2.5 2.3 3.44 4.18 8.33 1.21 7.33 3.54 2.42 ...
##   ..$ Q25   : num [1:30] 2.28 1.81 1.61 2.58 2.24 4.02 0.49 6.27 2.85 1.02 ...
##   ..$ Q50   : num [1:30] 3.01 2.37 1.66 2.83 3.26 4.82 0.66 6.4 2.99 1.55 ...
##   ..$ Q75   : num [1:30] 3.16 2.48 1.83 3.24 3.65 6.63 1.09 6.45 3.29 1.72 ...
##  $ comparison: NULL
##  $ groups    :'data.frame':  30 obs. of  2 variables:
##   ..$ rootdw: num [1:30] 6.5 6.4 6.39 6.19 6.19 ...
##   ..$ groups: chr [1:30] "a" "a" "a" "a" ...
##  - attr(*, "class")= chr "group"

grupos <- tukey_interaccion$groups %>% 
  rownames_to_column("Tratamientos") %>% 
  separate("Tratamientos", into = c("riego","geno"))

str(grupos)
## 'data.frame':    30 obs. of  4 variables:
##  $ riego : chr  "sequia" "irrigado" "sequia" "irrigado" ...
##  $ geno  : chr  "G08" "G08" "G14" "G14" ...
##  $ rootdw: num  6.5 6.4 6.39 6.19 6.19 ...
##  $ groups: chr  "a" "a" "a" "a" ...
ggplot(grupos, aes(x = geno, y = rootdw, fill = riego)) +
  geom_bar(stat = "identity", position = position_dodge()) +
  geom_text(aes(label = groups), 
            position = position_dodge(width = 0.9), 
            vjust = -0.3, 
            size = 3) +  
  labs(title = "Efecto de Geno y Riego en ROOTDW",
       x = "Genotipo",
       y = "ROOTDW") +
  theme_minimal() +
  scale_fill_discrete(name = "Riego") +
  theme(axis.text.x = element_text(angle = 45, hjust = 1))

6.3 Peso seco del tubérculo (g)

6.3.1 Modelo lineal de tubdw

ANOVA

modelo <- aov(formula = tubdw ~  bloque + riego + geno + riego*geno
          , data = fb)

anova(modelo)
## Analysis of Variance Table
## 
## Response: tubdw
##             Df  Sum Sq Mean Sq  F value                Pr(>F)    
## bloque       4  1788.7   447.2   5.0658             0.0008473 ***
## riego        1  9754.4  9754.4 110.5009 < 0.00000000000000022 ***
## geno        14 20528.6  1466.3  16.6111 < 0.00000000000000022 ***
## riego:geno  14  2139.7   152.8   1.7313             0.0583468 .  
## Residuals  116 10239.8    88.3                                   
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Prueba de normalidad

plot(modelo)

Interacción de niveles de riego y Geno

library(ggplot2)
ggplot(fb, aes(x = geno, y = tubdw, colour = riego)) +
  geom_boxplot(outlier.colour = "red", outlier.shape = 16, outlier.size = 2) +
  labs(title = "Boxplot con interacción de niveles de riego y genotipo",
       x = "Interacción Riego y Genotipo",
       y = "Peso seco del tubérculo (g)")

  theme_minimal() +
  theme(axis.text.x = element_text(angle = 45, hjust = 1))  # Inclinar etiquetas del eje X
## List of 136
##  $ line                            :List of 6
##   ..$ colour       : chr "black"
##   ..$ linewidth    : num 0.5
##   ..$ linetype     : num 1
##   ..$ lineend      : chr "butt"
##   ..$ arrow        : logi FALSE
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_line" "element"
##  $ rect                            :List of 5
##   ..$ fill         : chr "white"
##   ..$ colour       : chr "black"
##   ..$ linewidth    : num 0.5
##   ..$ linetype     : num 1
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_rect" "element"
##  $ text                            :List of 11
##   ..$ family       : chr ""
##   ..$ face         : chr "plain"
##   ..$ colour       : chr "black"
##   ..$ size         : num 11
##   ..$ hjust        : num 0.5
##   ..$ vjust        : num 0.5
##   ..$ angle        : num 0
##   ..$ lineheight   : num 0.9
##   ..$ margin       : 'margin' num [1:4] 0points 0points 0points 0points
##   .. ..- attr(*, "unit")= int 8
##   ..$ debug        : logi FALSE
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ title                           : NULL
##  $ aspect.ratio                    : NULL
##  $ axis.title                      : NULL
##  $ axis.title.x                    :List of 11
##   ..$ family       : NULL
##   ..$ face         : NULL
##   ..$ colour       : NULL
##   ..$ size         : NULL
##   ..$ hjust        : NULL
##   ..$ vjust        : num 1
##   ..$ angle        : NULL
##   ..$ lineheight   : NULL
##   ..$ margin       : 'margin' num [1:4] 2.75points 0points 0points 0points
##   .. ..- attr(*, "unit")= int 8
##   ..$ debug        : NULL
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ axis.title.x.top                :List of 11
##   ..$ family       : NULL
##   ..$ face         : NULL
##   ..$ colour       : NULL
##   ..$ size         : NULL
##   ..$ hjust        : NULL
##   ..$ vjust        : num 0
##   ..$ angle        : NULL
##   ..$ lineheight   : NULL
##   ..$ margin       : 'margin' num [1:4] 0points 0points 2.75points 0points
##   .. ..- attr(*, "unit")= int 8
##   ..$ debug        : NULL
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ axis.title.x.bottom             : NULL
##  $ axis.title.y                    :List of 11
##   ..$ family       : NULL
##   ..$ face         : NULL
##   ..$ colour       : NULL
##   ..$ size         : NULL
##   ..$ hjust        : NULL
##   ..$ vjust        : num 1
##   ..$ angle        : num 90
##   ..$ lineheight   : NULL
##   ..$ margin       : 'margin' num [1:4] 0points 2.75points 0points 0points
##   .. ..- attr(*, "unit")= int 8
##   ..$ debug        : NULL
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ axis.title.y.left               : NULL
##  $ axis.title.y.right              :List of 11
##   ..$ family       : NULL
##   ..$ face         : NULL
##   ..$ colour       : NULL
##   ..$ size         : NULL
##   ..$ hjust        : NULL
##   ..$ vjust        : num 1
##   ..$ angle        : num -90
##   ..$ lineheight   : NULL
##   ..$ margin       : 'margin' num [1:4] 0points 0points 0points 2.75points
##   .. ..- attr(*, "unit")= int 8
##   ..$ debug        : NULL
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ axis.text                       :List of 11
##   ..$ family       : NULL
##   ..$ face         : NULL
##   ..$ colour       : chr "grey30"
##   ..$ size         : 'rel' num 0.8
##   ..$ hjust        : NULL
##   ..$ vjust        : NULL
##   ..$ angle        : NULL
##   ..$ lineheight   : NULL
##   ..$ margin       : NULL
##   ..$ debug        : NULL
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ axis.text.x                     :List of 11
##   ..$ family       : NULL
##   ..$ face         : NULL
##   ..$ colour       : NULL
##   ..$ size         : NULL
##   ..$ hjust        : num 1
##   ..$ vjust        : num 1
##   ..$ angle        : num 45
##   ..$ lineheight   : NULL
##   ..$ margin       : 'margin' num [1:4] 2.2points 0points 0points 0points
##   .. ..- attr(*, "unit")= int 8
##   ..$ debug        : NULL
##   ..$ inherit.blank: logi FALSE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ axis.text.x.top                 :List of 11
##   ..$ family       : NULL
##   ..$ face         : NULL
##   ..$ colour       : NULL
##   ..$ size         : NULL
##   ..$ hjust        : NULL
##   ..$ vjust        : num 0
##   ..$ angle        : NULL
##   ..$ lineheight   : NULL
##   ..$ margin       : 'margin' num [1:4] 0points 0points 2.2points 0points
##   .. ..- attr(*, "unit")= int 8
##   ..$ debug        : NULL
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ axis.text.x.bottom              : NULL
##  $ axis.text.y                     :List of 11
##   ..$ family       : NULL
##   ..$ face         : NULL
##   ..$ colour       : NULL
##   ..$ size         : NULL
##   ..$ hjust        : num 1
##   ..$ vjust        : NULL
##   ..$ angle        : NULL
##   ..$ lineheight   : NULL
##   ..$ margin       : 'margin' num [1:4] 0points 2.2points 0points 0points
##   .. ..- attr(*, "unit")= int 8
##   ..$ debug        : NULL
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ axis.text.y.left                : NULL
##  $ axis.text.y.right               :List of 11
##   ..$ family       : NULL
##   ..$ face         : NULL
##   ..$ colour       : NULL
##   ..$ size         : NULL
##   ..$ hjust        : num 0
##   ..$ vjust        : NULL
##   ..$ angle        : NULL
##   ..$ lineheight   : NULL
##   ..$ margin       : 'margin' num [1:4] 0points 0points 0points 2.2points
##   .. ..- attr(*, "unit")= int 8
##   ..$ debug        : NULL
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ axis.text.theta                 : NULL
##  $ axis.text.r                     :List of 11
##   ..$ family       : NULL
##   ..$ face         : NULL
##   ..$ colour       : NULL
##   ..$ size         : NULL
##   ..$ hjust        : num 0.5
##   ..$ vjust        : NULL
##   ..$ angle        : NULL
##   ..$ lineheight   : NULL
##   ..$ margin       : 'margin' num [1:4] 0points 2.2points 0points 2.2points
##   .. ..- attr(*, "unit")= int 8
##   ..$ debug        : NULL
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ axis.ticks                      : list()
##   ..- attr(*, "class")= chr [1:2] "element_blank" "element"
##  $ axis.ticks.x                    : NULL
##  $ axis.ticks.x.top                : NULL
##  $ axis.ticks.x.bottom             : NULL
##  $ axis.ticks.y                    : NULL
##  $ axis.ticks.y.left               : NULL
##  $ axis.ticks.y.right              : NULL
##  $ axis.ticks.theta                : NULL
##  $ axis.ticks.r                    : NULL
##  $ axis.minor.ticks.x.top          : NULL
##  $ axis.minor.ticks.x.bottom       : NULL
##  $ axis.minor.ticks.y.left         : NULL
##  $ axis.minor.ticks.y.right        : NULL
##  $ axis.minor.ticks.theta          : NULL
##  $ axis.minor.ticks.r              : NULL
##  $ axis.ticks.length               : 'simpleUnit' num 2.75points
##   ..- attr(*, "unit")= int 8
##  $ axis.ticks.length.x             : NULL
##  $ axis.ticks.length.x.top         : NULL
##  $ axis.ticks.length.x.bottom      : NULL
##  $ axis.ticks.length.y             : NULL
##  $ axis.ticks.length.y.left        : NULL
##  $ axis.ticks.length.y.right       : NULL
##  $ axis.ticks.length.theta         : NULL
##  $ axis.ticks.length.r             : NULL
##  $ axis.minor.ticks.length         : 'rel' num 0.75
##  $ axis.minor.ticks.length.x       : NULL
##  $ axis.minor.ticks.length.x.top   : NULL
##  $ axis.minor.ticks.length.x.bottom: NULL
##  $ axis.minor.ticks.length.y       : NULL
##  $ axis.minor.ticks.length.y.left  : NULL
##  $ axis.minor.ticks.length.y.right : NULL
##  $ axis.minor.ticks.length.theta   : NULL
##  $ axis.minor.ticks.length.r       : NULL
##  $ axis.line                       : list()
##   ..- attr(*, "class")= chr [1:2] "element_blank" "element"
##  $ axis.line.x                     : NULL
##  $ axis.line.x.top                 : NULL
##  $ axis.line.x.bottom              : NULL
##  $ axis.line.y                     : NULL
##  $ axis.line.y.left                : NULL
##  $ axis.line.y.right               : NULL
##  $ axis.line.theta                 : NULL
##  $ axis.line.r                     : NULL
##  $ legend.background               : list()
##   ..- attr(*, "class")= chr [1:2] "element_blank" "element"
##  $ legend.margin                   : 'margin' num [1:4] 5.5points 5.5points 5.5points 5.5points
##   ..- attr(*, "unit")= int 8
##  $ legend.spacing                  : 'simpleUnit' num 11points
##   ..- attr(*, "unit")= int 8
##  $ legend.spacing.x                : NULL
##  $ legend.spacing.y                : NULL
##  $ legend.key                      : list()
##   ..- attr(*, "class")= chr [1:2] "element_blank" "element"
##  $ legend.key.size                 : 'simpleUnit' num 1.2lines
##   ..- attr(*, "unit")= int 3
##  $ legend.key.height               : NULL
##  $ legend.key.width                : NULL
##  $ legend.key.spacing              : 'simpleUnit' num 5.5points
##   ..- attr(*, "unit")= int 8
##  $ legend.key.spacing.x            : NULL
##  $ legend.key.spacing.y            : NULL
##  $ legend.frame                    : NULL
##  $ legend.ticks                    : NULL
##  $ legend.ticks.length             : 'rel' num 0.2
##  $ legend.axis.line                : NULL
##  $ legend.text                     :List of 11
##   ..$ family       : NULL
##   ..$ face         : NULL
##   ..$ colour       : NULL
##   ..$ size         : 'rel' num 0.8
##   ..$ hjust        : NULL
##   ..$ vjust        : NULL
##   ..$ angle        : NULL
##   ..$ lineheight   : NULL
##   ..$ margin       : NULL
##   ..$ debug        : NULL
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ legend.text.position            : NULL
##  $ legend.title                    :List of 11
##   ..$ family       : NULL
##   ..$ face         : NULL
##   ..$ colour       : NULL
##   ..$ size         : NULL
##   ..$ hjust        : num 0
##   ..$ vjust        : NULL
##   ..$ angle        : NULL
##   ..$ lineheight   : NULL
##   ..$ margin       : NULL
##   ..$ debug        : NULL
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ legend.title.position           : NULL
##  $ legend.position                 : chr "right"
##  $ legend.position.inside          : NULL
##  $ legend.direction                : NULL
##  $ legend.byrow                    : NULL
##  $ legend.justification            : chr "center"
##  $ legend.justification.top        : NULL
##  $ legend.justification.bottom     : NULL
##  $ legend.justification.left       : NULL
##  $ legend.justification.right      : NULL
##  $ legend.justification.inside     : NULL
##  $ legend.location                 : NULL
##  $ legend.box                      : NULL
##  $ legend.box.just                 : NULL
##  $ legend.box.margin               : 'margin' num [1:4] 0cm 0cm 0cm 0cm
##   ..- attr(*, "unit")= int 1
##  $ legend.box.background           : list()
##   ..- attr(*, "class")= chr [1:2] "element_blank" "element"
##  $ legend.box.spacing              : 'simpleUnit' num 11points
##   ..- attr(*, "unit")= int 8
##   [list output truncated]
##  - attr(*, "class")= chr [1:2] "theme" "gg"
##  - attr(*, "complete")= logi TRUE
##  - attr(*, "validate")= logi TRUE

6.3.2 Modelo lineal mixto

library(lme4)

library(lmerTest)

model <- lme4::lmer(formula = tubdw ~ riego * geno + (1|bloque), data = fb)
anova(model)
## Analysis of Variance Table
##            npar  Sum Sq Mean Sq  F value
## riego         1  9754.4  9754.4 110.5009
## geno         14 20528.6  1466.3  16.6111
## riego:geno   14  2139.7   152.8   1.7313

Prueba de normalida

plot(modelo)

Eliminación de datos atípicos

ol <- boxplot(tubdw ~ riego * geno, fb)


ol
## $stats
##       [,1]  [,2]  [,3]  [,4]  [,5]  [,6]  [,7]  [,8]  [,9] [,10] [,11] [,12]
## [1,] 22.45 15.33 25.48 10.20 29.93 27.00 46.89 25.92 36.44 21.54  9.58  2.37
## [2,] 28.16 19.44 25.48 13.42 35.59 27.72 46.89 25.92 36.46 21.59 12.21  4.32
## [3,] 36.06 19.80 27.18 13.51 47.52 30.19 57.32 26.66 51.44 26.82 13.72  5.17
## [4,] 38.02 27.56 29.09 16.80 51.15 30.92 62.54 26.94 61.60 28.74 15.66  5.68
## [5,] 45.29 33.12 30.23 17.67 67.71 35.63 76.86 27.52 70.07 36.86 15.66  5.68
##      [,13] [,14] [,15] [,16] [,17] [,18] [,19] [,20] [,21] [,22] [,23] [,24]
## [1,] 11.81 10.75 21.96  4.05 50.34 21.00 19.44 21.36 38.76 23.80 31.66 19.21
## [2,] 12.79 11.63 25.48 10.52 56.52 34.89 20.38 22.76 41.47 24.40 34.09 19.75
## [3,] 13.48 14.79 26.72 14.55 57.22 37.41 26.29 26.09 52.67 40.64 40.62 20.44
## [4,] 35.35 19.79 28.52 17.49 68.89 44.54 34.49 30.86 59.92 41.95 53.58 22.21
## [5,] 42.67 20.52 28.52 18.90 86.16 44.83 48.73 31.69 64.12 45.43 61.34 23.44
##      [,25] [,26] [,27] [,28] [,29] [,30]
## [1,] 22.03 12.25 18.21 19.05 45.41 23.78
## [2,] 23.81 15.25 29.72 19.63 62.46 33.75
## [3,] 25.72 16.10 37.46 22.97 68.86 39.54
## [4,] 26.68 18.67 48.56 27.86 78.62 49.95
## [5,] 27.44 21.13 53.68 30.27 78.64 50.53
## 
## $n
##  [1] 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5
## 
## $conf
##          [,1]     [,2]     [,3]    [,4]     [,5]     [,6]     [,7]     [,8]
## [1,] 29.09295 14.06243 24.62918 11.1217 36.52534 27.92889 46.26175 25.93927
## [2,] 43.02705 25.53757 29.73082 15.8983 58.51466 32.45111 68.37825 27.38073
##          [,9]    [,10]    [,11]    [,12]     [,13]     [,14]    [,15]     [,16]
## [1,] 33.67614 21.76783 11.28224 4.209027 -2.460839  9.024165 24.57194  9.625016
## [2,] 69.20386 31.87217 16.15776 6.130973 29.420839 20.555835 28.86806 19.474984
##         [,17]    [,18]    [,19]    [,20]    [,21]    [,22]    [,23]    [,24]
## [1,] 48.47939 30.59133 16.31991 20.36656 39.63328 28.23921 26.84842 18.70177
## [2,] 65.96061 44.22867 36.26009 31.81344 65.70672 53.04079 54.39158 22.17823
##         [,25]    [,26]   [,27]   [,28]    [,29]    [,30]
## [1,] 23.69207 13.68344 24.1477 17.1547 57.44138 28.09312
## [2,] 27.74793 18.51656 50.7723 28.7853 80.27862 50.98688
## 
## $out
## [1] 13.17 18.95 22.34 34.79 12.78 39.26
## 
## $group
## [1]  3  7  8 11 12 15
## 
## $names
##  [1] "irrigado.G01" "sequia.G01"   "irrigado.G02" "sequia.G02"   "irrigado.G03"
##  [6] "sequia.G03"   "irrigado.G04" "sequia.G04"   "irrigado.G05" "sequia.G05"  
## [11] "irrigado.G06" "sequia.G06"   "irrigado.G07" "sequia.G07"   "irrigado.G08"
## [16] "sequia.G08"   "irrigado.G09" "sequia.G09"   "irrigado.G10" "sequia.G10"  
## [21] "irrigado.G11" "sequia.G11"   "irrigado.G12" "sequia.G12"   "irrigado.G13"
## [26] "sequia.G13"   "irrigado.G14" "sequia.G14"   "irrigado.G15" "sequia.G15"
library(inti)

model <- remove_outliers(data = fb
                             , formula = tubdw ~ riego * geno + (1|bloque)
                         , plot_diag = T)
model
## $data
## $data$raw
## # A tibble: 150 × 5
##    index riego    geno  bloque tubdw
##    <chr> <chr>    <chr> <chr>  <dbl>
##  1 1     sequia   G01   II     19.8 
##  2 2     sequia   G02   IV     17.7 
##  3 3     irrigado G01   III    38.0 
##  4 4     sequia   G02   I      13.5 
##  5 5     irrigado G03   II     51.2 
##  6 6     irrigado G04   V      62.5 
##  7 7     irrigado G01   I      22.4 
##  8 8     irrigado G05   IV     51.4 
##  9 9     sequia   G06   II      2.37
## 10 10    sequia   G05   I      28.7 
## # ℹ 140 more rows
## 
## $data$clean
##     index    riego geno bloque tubdw
## 1       1   sequia  G01     II 19.80
## 2       2   sequia  G02     IV 17.67
## 3       3 irrigado  G01    III 38.02
## 4       4   sequia  G02      I 13.51
## 5       5 irrigado  G03     II 51.15
## 6       6 irrigado  G04      V 62.54
## 7       7 irrigado  G01      I 22.45
## 8       8 irrigado  G05     IV 51.44
## 9       9   sequia  G06     II  2.37
## 10     10   sequia  G05      I 28.74
## 11     11 irrigado  G01     II 36.06
## 12     12   sequia  G07     II 19.79
## 13     13 irrigado  G08     II 21.96
## 14     14 irrigado  G06    III 15.66
## 15     15 irrigado  G09    III 57.22
## 16     16 irrigado  G10     II 26.29
## 17     17   sequia  G11      I 41.95
## 18     18   sequia  G12    III 19.21
## 19     19 irrigado  G07      I 12.79
## 20     20 irrigado  G04     II 46.89
## 21     21 irrigado  G13     II 22.03
## 22     22 irrigado  G14    III 18.21
## 23     23 irrigado  G04     IV 57.32
## 24     24   sequia  G04      V 22.34
## 25     25   sequia  G08      V 18.90
## 26     26   sequia  G04    III 26.94
## 27     27   sequia  G01     IV 27.56
## 28     28 irrigado  G10      I 19.44
## 29     29 irrigado  G08      V 28.52
## 30     30 irrigado  G02      V 30.23
## 31     31 irrigado  G07    III 42.67
## 32     32 irrigado  G08      I 25.48
## 33     33 irrigado  G14      V 48.56
## 34     34 irrigado  G03      I 29.93
## 35     35   sequia  G13    III 12.25
## 36     36   sequia  G01      V 19.44
## 37     37   sequia  G03      I 27.00
## 38     38 irrigado  G15    III 78.62
## 39     39 irrigado  G03     IV 67.71
## 40     40 irrigado  G09     IV 86.16
## 41     41 irrigado  G11     II 38.76
## 42     42   sequia  G03      V 27.72
## 43     43   sequia  G11    III 40.64
## 44     44 irrigado  G06      V 13.72
## 45     45   sequia  G05      V 36.86
## 46     46   sequia  G08     IV 17.49
## 47     47 irrigado  G11     IV 52.67
## 48     48   sequia  G11     II 24.40
## 49     49 irrigado  G10    III 48.73
## 50     50   sequia  G06     IV  5.68
## 51     51   sequia  G09      I 21.00
## 52     52 irrigado  G11      I 41.47
## 53     53   sequia  G11     IV 45.43
## 54     54 irrigado  G15     IV 45.41
## 55     55 irrigado  G13     IV 27.44
## 56     56   sequia  G14      V 30.27
## 57     57 irrigado  G02     IV 25.48
## 58     58 irrigado  G09     II 68.89
## 59     59 irrigado  G02    III 27.18
## 60     60   sequia  G08    III 14.55
## 61     61 irrigado  G06     II  9.58
## 62     62   sequia  G13     IV 15.25
## 63     63   sequia  G14    III 19.05
## 64     64   sequia  G04     II 27.52
## 65     65 irrigado  G11    III 64.12
## 66     66 irrigado  G07     II 11.81
## 67     67 irrigado  G08     IV 26.72
## 68     68   sequia  G05     IV 21.54
## 69     69 irrigado  G04      I    NA
## 70     70 irrigado  G11      V 59.92
## 71     71 irrigado  G12      I 40.62
## 72     72   sequia  G14     IV 22.97
## 73     73   sequia  G07    III 20.52
## 74     74 irrigado  G03    III 35.59
## 75     75   sequia  G01      I 15.33
## 76     76   sequia  G04      I 25.92
## 77     77   sequia  G03     II 35.63
## 78     78 irrigado  G15     II 78.64
## 79     79   sequia  G12     IV 20.44
## 80     80   sequia  G12      I 22.21
## 81     81   sequia  G08      I  4.05
## 82     82   sequia  G05     II 21.59
## 83     83   sequia  G02     II 10.20
## 84     84   sequia  G10      I 21.36
## 85     85   sequia  G15      I 50.53
## 86     86 irrigado  G07      V 13.48
## 87     87   sequia  G10      V 31.69
## 88     88   sequia  G13     II 16.10
## 89     89   sequia  G07      V 14.79
## 90     90   sequia  G03    III 30.19
## 91     91   sequia  G15     IV 39.54
## 92     92   sequia  G13      I 18.67
## 93     93   sequia  G03     IV 30.92
## 94     94 irrigado  G10      V 34.49
## 95     95   sequia  G13      V 21.13
## 96     96   sequia  G09     II 34.89
## 97     97 irrigado  G14     IV 53.68
## 98     98 irrigado  G01      V 28.16
## 99     99   sequia  G01    III 33.12
## 100   100 irrigado  G06     IV 34.79
## 101   101   sequia  G04     IV 26.66
## 102   102 irrigado  G15      V 62.46
## 103   103 irrigado  G13    III 25.72
## 104   104 irrigado  G02     II 29.09
## 105   105   sequia  G08     II 10.52
## 106   106 irrigado  G04    III 76.86
## 107   107   sequia  G02      V 13.42
## 108   108   sequia  G06      V 12.78
## 109   109 irrigado  G15      I 68.86
## 110   110 irrigado  G13      V 26.68
## 111   111 irrigado  G05      V 36.46
## 112   112   sequia  G09    III 37.41
## 113   113   sequia  G09      V 44.54
## 114   114   sequia  G10     II 22.76
## 115   115 irrigado  G07     IV 35.35
## 116   116 irrigado  G05      I 36.44
## 117   117 irrigado  G02      I 13.17
## 118   118   sequia  G05    III 26.82
## 119   119 irrigado  G12     II 31.66
## 120   120   sequia  G15    III 33.75
## 121   121 irrigado  G13      I 23.81
## 122   122   sequia  G14     II 27.86
## 123   123   sequia  G12     II 23.44
## 124   124   sequia  G15     II 23.78
## 125   125 irrigado  G09      V 56.52
## 126   126   sequia  G06      I  5.17
## 127   127   sequia  G09     IV 44.83
## 128   128   sequia  G15      V 49.95
## 129   129 irrigado  G14      I 29.72
## 130   130   sequia  G06    III  4.32
## 131   131 irrigado  G01     IV 45.29
## 132   132 irrigado  G12    III 53.58
## 133   133   sequia  G12      V 19.75
## 134   134 irrigado  G12      V 61.34
## 135   135   sequia  G11      V 23.80
## 136   136 irrigado  G12     IV 34.09
## 137   137 irrigado  G09      I 50.34
## 138   138   sequia  G02    III 16.80
## 139   139   sequia  G07      I 11.63
## 140   140 irrigado  G08    III 39.26
## 141   141 irrigado  G06      I 12.21
## 142   142 irrigado  G10     IV 20.38
## 143   143 irrigado  G03      V 47.52
## 144   144   sequia  G07     IV 10.75
## 145   145 irrigado  G05    III 61.60
## 146   146   sequia  G14      I 19.63
## 147   147   sequia  G10    III 30.86
## 148   148 irrigado  G14     II 37.46
## 149   149 irrigado  G05     II 70.07
## 150   150   sequia  G10     IV 26.09
## 
## 
## $outliers
##    index    riego geno bloque tubdw      resi   res_MAD   rawp.BHStud
## 69    69 irrigado  G04      I 18.95 -28.76959 -4.125053 0.00003706494
##             adjp       bholm out_flag
## 69 0.00003706494 0.005559741  OUTLIER
## 
## $diagplot

## 
## $model
## $model$raw
## Linear mixed model fit by REML ['lmerMod']
## Formula: tubdw ~ riego * geno + (1 | bloque)
##    Data: rawdt
## REML criterion at convergence: 932.9721
## Random effects:
##  Groups   Name        Std.Dev.
##  bloque   (Intercept) 3.459   
##  Residual             9.395   
## Number of obs: 150, groups:  bloque, 5
## Fixed Effects:
##         (Intercept)          riegosequia              genoG02  
##              33.996              -10.946               -8.966  
##             genoG03              genoG04              genoG05  
##              12.384               18.516               17.206  
##             genoG06              genoG07              genoG08  
##             -16.804              -10.776               -5.608  
##             genoG09              genoG10              genoG11  
##              29.830               -4.130               17.392  
##             genoG12              genoG13              genoG14  
##              10.262               -8.860                3.530  
##             genoG15  riegosequia:genoG02  riegosequia:genoG03  
##              32.802                0.236               -5.142  
## riegosequia:genoG04  riegosequia:genoG05  riegosequia:genoG06  
##             -15.690              -13.146               -0.182  
## riegosequia:genoG07  riegosequia:genoG08  riegosequia:genoG09  
##               3.222               -4.340              -16.346  
## riegosequia:genoG10  riegosequia:genoG11  riegosequia:genoG12  
##               7.632               -5.198              -12.302  
## riegosequia:genoG13  riegosequia:genoG14  riegosequia:genoG15  
##               2.490               -2.624              -16.342  
## 
## $model$clean
## Linear mixed model fit by REML ['lmerMod']
## Formula: tubdw ~ riego * geno + (1 | bloque)
##    Data: cleandt
## REML criterion at convergence: 913.7656
## Random effects:
##  Groups   Name        Std.Dev.
##  bloque   (Intercept) 2.975   
##  Residual             8.972   
## Number of obs: 149, groups:  bloque, 5
## Fixed Effects:
##         (Intercept)          riegosequia              genoG02  
##              33.996              -10.946               -8.966  
##             genoG03              genoG04              genoG05  
##              12.384               25.951               17.206  
##             genoG06              genoG07              genoG08  
##             -16.804              -10.776               -5.608  
##             genoG09              genoG10              genoG11  
##              29.830               -4.130               17.392  
##             genoG12              genoG13              genoG14  
##              10.262               -8.860                3.530  
##             genoG15  riegosequia:genoG02  riegosequia:genoG03  
##              32.802                0.236               -5.142  
## riegosequia:genoG04  riegosequia:genoG05  riegosequia:genoG06  
##             -23.125              -13.146               -0.182  
## riegosequia:genoG07  riegosequia:genoG08  riegosequia:genoG09  
##               3.222               -4.340              -16.346  
## riegosequia:genoG10  riegosequia:genoG11  riegosequia:genoG12  
##               7.632               -5.198              -12.302  
## riegosequia:genoG13  riegosequia:genoG14  riegosequia:genoG15  
##               2.490               -2.624              -16.342

Comparación de medias

library(agricolae)
library(tidyverse)
tukey_interaccion <- HSD.test(modelo, c("riego","geno"), group = TRUE)
print(tukey_interaccion)
## $statistics
##    MSerror  Df     Mean       CV      MSD
##   88.27419 116 31.71713 29.62258 22.84993
## 
## $parameters
##    test     name.t ntr StudentizedRange alpha
##   Tukey riego:geno  30         5.438172  0.05
## 
## $means
##               tubdw       std r       se   Min   Max   Q25   Q50   Q75
## irrigado:G01 33.996  8.879416 5 4.201766 22.45 45.29 28.16 36.06 38.02
## irrigado:G02 25.030  6.874013 5 4.201766 13.17 30.23 25.48 27.18 29.09
## irrigado:G03 46.380 14.714347 5 4.201766 29.93 67.71 35.59 47.52 51.15
## irrigado:G04 52.512 21.647849 5 4.201766 18.95 76.86 46.89 57.32 62.54
## irrigado:G05 51.202 14.995163 5 4.201766 36.44 70.07 36.46 51.44 61.60
## irrigado:G06 17.192 10.085315 5 4.201766  9.58 34.79 12.21 13.72 15.66
## irrigado:G07 23.220 14.656739 5 4.201766 11.81 42.67 12.79 13.48 35.35
## irrigado:G08 28.388  6.534058 5 4.201766 21.96 39.26 25.48 26.72 28.52
## irrigado:G09 63.826 14.171633 5 4.201766 50.34 86.16 56.52 57.22 68.89
## irrigado:G10 29.866 12.131625 5 4.201766 19.44 48.73 20.38 26.29 34.49
## irrigado:G11 51.388 11.117278 5 4.201766 38.76 64.12 41.47 52.67 59.92
## irrigado:G12 44.258 12.786979 5 4.201766 31.66 61.34 34.09 40.62 53.58
## irrigado:G13 25.136  2.204480 5 4.201766 22.03 27.44 23.81 25.72 26.68
## irrigado:G14 37.526 14.289390 5 4.201766 18.21 53.68 29.72 37.46 48.56
## irrigado:G15 66.798 13.788666 5 4.201766 45.41 78.64 62.46 68.86 78.62
## sequia:G01   23.050  7.157828 5 4.201766 15.33 33.12 19.44 19.80 27.56
## sequia:G02   14.320  2.992215 5 4.201766 10.20 17.67 13.42 13.51 16.80
## sequia:G03   30.292  3.404096 5 4.201766 27.00 35.63 27.72 30.19 30.92
## sequia:G04   25.876  2.058805 5 4.201766 22.34 27.52 25.92 26.66 26.94
## sequia:G05   27.110  6.310681 5 4.201766 21.54 36.86 21.59 26.82 28.74
## sequia:G06    6.064  3.960383 5 4.201766  2.37 12.78  4.32  5.17  5.68
## sequia:G07   15.496  4.517962 5 4.201766 10.75 20.52 11.63 14.79 19.79
## sequia:G08   13.102  5.991108 5 4.201766  4.05 18.90 10.52 14.55 17.49
## sequia:G09   36.534  9.717187 5 4.201766 21.00 44.83 34.89 37.41 44.54
## sequia:G10   26.552  4.650470 5 4.201766 21.36 31.69 22.76 26.09 30.86
## sequia:G11   35.244 10.324719 5 4.201766 23.80 45.43 24.40 40.64 41.95
## sequia:G12   21.010  1.767583 5 4.201766 19.21 23.44 19.75 20.44 22.21
## sequia:G13   16.680  3.382632 5 4.201766 12.25 21.13 15.25 16.10 18.67
## sequia:G14   23.956  4.971497 5 4.201766 19.05 30.27 19.63 22.97 27.86
## sequia:G15   39.510 11.303157 5 4.201766 23.78 50.53 33.75 39.54 49.95
## 
## $comparison
## NULL
## 
## $groups
##               tubdw   groups
## irrigado:G15 66.798        a
## irrigado:G09 63.826        a
## irrigado:G04 52.512       ab
## irrigado:G11 51.388       ab
## irrigado:G05 51.202      abc
## irrigado:G03 46.380     abcd
## irrigado:G12 44.258    abcde
## sequia:G15   39.510    bcdef
## irrigado:G14 37.526   bcdefg
## sequia:G09   36.534  bcdefgh
## sequia:G11   35.244 bcdefghi
## irrigado:G01 33.996 bcdefghi
## sequia:G03   30.292 bcdefghi
## irrigado:G10 29.866 bcdefghi
## irrigado:G08 28.388 cdefghij
## sequia:G05   27.110  defghij
## sequia:G10   26.552  defghij
## sequia:G04   25.876  defghij
## irrigado:G13 25.136  defghij
## irrigado:G02 25.030  defghij
## sequia:G14   23.956  defghij
## irrigado:G07 23.220   efghij
## sequia:G01   23.050   efghij
## sequia:G12   21.010    fghij
## irrigado:G06 17.192    fghij
## sequia:G13   16.680    fghij
## sequia:G07   15.496     ghij
## sequia:G02   14.320      hij
## sequia:G08   13.102       ij
## sequia:G06    6.064        j
## 
## attr(,"class")
## [1] "group"
plot(tukey_interaccion)


str(tukey_interaccion)
## List of 5
##  $ statistics:'data.frame':  1 obs. of  5 variables:
##   ..$ MSerror: num 88.3
##   ..$ Df     : int 116
##   ..$ Mean   : num 31.7
##   ..$ CV     : num 29.6
##   ..$ MSD    : num 22.8
##  $ parameters:'data.frame':  1 obs. of  5 variables:
##   ..$ test            : chr "Tukey"
##   ..$ name.t          : chr "riego:geno"
##   ..$ ntr             : int 30
##   ..$ StudentizedRange: num 5.44
##   ..$ alpha           : num 0.05
##  $ means     :'data.frame':  30 obs. of  9 variables:
##   ..$ tubdw: num [1:30] 34 25 46.4 52.5 51.2 ...
##   ..$ std  : num [1:30] 8.88 6.87 14.71 21.65 15 ...
##   ..$ r    : int [1:30] 5 5 5 5 5 5 5 5 5 5 ...
##   ..$ se   : num [1:30] 4.2 4.2 4.2 4.2 4.2 ...
##   ..$ Min  : num [1:30] 22.4 13.2 29.9 18.9 36.4 ...
##   ..$ Max  : num [1:30] 45.3 30.2 67.7 76.9 70.1 ...
##   ..$ Q25  : num [1:30] 28.2 25.5 35.6 46.9 36.5 ...
##   ..$ Q50  : num [1:30] 36.1 27.2 47.5 57.3 51.4 ...
##   ..$ Q75  : num [1:30] 38 29.1 51.1 62.5 61.6 ...
##  $ comparison: NULL
##  $ groups    :'data.frame':  30 obs. of  2 variables:
##   ..$ tubdw : num [1:30] 66.8 63.8 52.5 51.4 51.2 ...
##   ..$ groups: chr [1:30] "a" "a" "ab" "ab" ...
##  - attr(*, "class")= chr "group"

grupos <- tukey_interaccion$groups %>% 
  rownames_to_column("Tratamientos") %>% 
  separate("Tratamientos", into = c("riego","geno"))

str(grupos)
## 'data.frame':    30 obs. of  4 variables:
##  $ riego : chr  "irrigado" "irrigado" "irrigado" "irrigado" ...
##  $ geno  : chr  "G15" "G09" "G04" "G11" ...
##  $ tubdw : num  66.8 63.8 52.5 51.4 51.2 ...
##  $ groups: chr  "a" "a" "ab" "ab" ...
ggplot(grupos, aes(x = geno, y = tubdw, fill = riego)) +
  geom_bar(stat = "identity", position = position_dodge()) +
  geom_text(aes(label = groups), 
            position = position_dodge(width = 0.9), 
            vjust = -0.3, 
            size = 3) +  
  labs(title = "Efecto de Geno y Riego en TUBDW",
       x = "Genotipo",
       y = "TUBDW") +
  theme_minimal() +
  scale_fill_discrete(name = "Riego") +
  theme(axis.text.x = element_text(angle = 45, hjust = 1))

6.4 Transpiración total (l)

6.4.1 Modelo lineal de ttrans

ANOVA

modelo <- aov(formula = ttrans ~  bloque + riego + geno + riego*geno
          , data = fb)

anova(modelo)
## Analysis of Variance Table
## 
## Response: ttrans
##             Df Sum Sq Mean Sq  F value               Pr(>F)    
## bloque       4  17.49    4.37   3.4162              0.01114 *  
## riego        1 416.31  416.31 325.3217 < 0.0000000000000002 ***
## geno        14 272.13   19.44  15.1897 < 0.0000000000000002 ***
## riego:geno  14  29.71    2.12   1.6585              0.07398 .  
## Residuals  116 148.44    1.28                                  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Prueba de normalidad

plot(modelo)

Interacción de niveles de riego y Geno

library(ggplot2)
ggplot(fb, aes(x = geno, y = ttrans, colour = riego)) +
  geom_boxplot(outlier.colour = "red", outlier.shape = 16, outlier.size = 2) +
  labs(title = "Boxplot con interacción de niveles de riego y genotipo",
       x = "Interacción Riego y Genotipo",
       y = "Transpiraciòn total")

  theme_minimal() +
  theme(axis.text.x = element_text(angle = 45, hjust = 1))  # Inclinar etiquetas del eje X
## List of 136
##  $ line                            :List of 6
##   ..$ colour       : chr "black"
##   ..$ linewidth    : num 0.5
##   ..$ linetype     : num 1
##   ..$ lineend      : chr "butt"
##   ..$ arrow        : logi FALSE
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_line" "element"
##  $ rect                            :List of 5
##   ..$ fill         : chr "white"
##   ..$ colour       : chr "black"
##   ..$ linewidth    : num 0.5
##   ..$ linetype     : num 1
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_rect" "element"
##  $ text                            :List of 11
##   ..$ family       : chr ""
##   ..$ face         : chr "plain"
##   ..$ colour       : chr "black"
##   ..$ size         : num 11
##   ..$ hjust        : num 0.5
##   ..$ vjust        : num 0.5
##   ..$ angle        : num 0
##   ..$ lineheight   : num 0.9
##   ..$ margin       : 'margin' num [1:4] 0points 0points 0points 0points
##   .. ..- attr(*, "unit")= int 8
##   ..$ debug        : logi FALSE
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ title                           : NULL
##  $ aspect.ratio                    : NULL
##  $ axis.title                      : NULL
##  $ axis.title.x                    :List of 11
##   ..$ family       : NULL
##   ..$ face         : NULL
##   ..$ colour       : NULL
##   ..$ size         : NULL
##   ..$ hjust        : NULL
##   ..$ vjust        : num 1
##   ..$ angle        : NULL
##   ..$ lineheight   : NULL
##   ..$ margin       : 'margin' num [1:4] 2.75points 0points 0points 0points
##   .. ..- attr(*, "unit")= int 8
##   ..$ debug        : NULL
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ axis.title.x.top                :List of 11
##   ..$ family       : NULL
##   ..$ face         : NULL
##   ..$ colour       : NULL
##   ..$ size         : NULL
##   ..$ hjust        : NULL
##   ..$ vjust        : num 0
##   ..$ angle        : NULL
##   ..$ lineheight   : NULL
##   ..$ margin       : 'margin' num [1:4] 0points 0points 2.75points 0points
##   .. ..- attr(*, "unit")= int 8
##   ..$ debug        : NULL
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ axis.title.x.bottom             : NULL
##  $ axis.title.y                    :List of 11
##   ..$ family       : NULL
##   ..$ face         : NULL
##   ..$ colour       : NULL
##   ..$ size         : NULL
##   ..$ hjust        : NULL
##   ..$ vjust        : num 1
##   ..$ angle        : num 90
##   ..$ lineheight   : NULL
##   ..$ margin       : 'margin' num [1:4] 0points 2.75points 0points 0points
##   .. ..- attr(*, "unit")= int 8
##   ..$ debug        : NULL
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ axis.title.y.left               : NULL
##  $ axis.title.y.right              :List of 11
##   ..$ family       : NULL
##   ..$ face         : NULL
##   ..$ colour       : NULL
##   ..$ size         : NULL
##   ..$ hjust        : NULL
##   ..$ vjust        : num 1
##   ..$ angle        : num -90
##   ..$ lineheight   : NULL
##   ..$ margin       : 'margin' num [1:4] 0points 0points 0points 2.75points
##   .. ..- attr(*, "unit")= int 8
##   ..$ debug        : NULL
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ axis.text                       :List of 11
##   ..$ family       : NULL
##   ..$ face         : NULL
##   ..$ colour       : chr "grey30"
##   ..$ size         : 'rel' num 0.8
##   ..$ hjust        : NULL
##   ..$ vjust        : NULL
##   ..$ angle        : NULL
##   ..$ lineheight   : NULL
##   ..$ margin       : NULL
##   ..$ debug        : NULL
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ axis.text.x                     :List of 11
##   ..$ family       : NULL
##   ..$ face         : NULL
##   ..$ colour       : NULL
##   ..$ size         : NULL
##   ..$ hjust        : num 1
##   ..$ vjust        : num 1
##   ..$ angle        : num 45
##   ..$ lineheight   : NULL
##   ..$ margin       : 'margin' num [1:4] 2.2points 0points 0points 0points
##   .. ..- attr(*, "unit")= int 8
##   ..$ debug        : NULL
##   ..$ inherit.blank: logi FALSE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ axis.text.x.top                 :List of 11
##   ..$ family       : NULL
##   ..$ face         : NULL
##   ..$ colour       : NULL
##   ..$ size         : NULL
##   ..$ hjust        : NULL
##   ..$ vjust        : num 0
##   ..$ angle        : NULL
##   ..$ lineheight   : NULL
##   ..$ margin       : 'margin' num [1:4] 0points 0points 2.2points 0points
##   .. ..- attr(*, "unit")= int 8
##   ..$ debug        : NULL
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ axis.text.x.bottom              : NULL
##  $ axis.text.y                     :List of 11
##   ..$ family       : NULL
##   ..$ face         : NULL
##   ..$ colour       : NULL
##   ..$ size         : NULL
##   ..$ hjust        : num 1
##   ..$ vjust        : NULL
##   ..$ angle        : NULL
##   ..$ lineheight   : NULL
##   ..$ margin       : 'margin' num [1:4] 0points 2.2points 0points 0points
##   .. ..- attr(*, "unit")= int 8
##   ..$ debug        : NULL
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ axis.text.y.left                : NULL
##  $ axis.text.y.right               :List of 11
##   ..$ family       : NULL
##   ..$ face         : NULL
##   ..$ colour       : NULL
##   ..$ size         : NULL
##   ..$ hjust        : num 0
##   ..$ vjust        : NULL
##   ..$ angle        : NULL
##   ..$ lineheight   : NULL
##   ..$ margin       : 'margin' num [1:4] 0points 0points 0points 2.2points
##   .. ..- attr(*, "unit")= int 8
##   ..$ debug        : NULL
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ axis.text.theta                 : NULL
##  $ axis.text.r                     :List of 11
##   ..$ family       : NULL
##   ..$ face         : NULL
##   ..$ colour       : NULL
##   ..$ size         : NULL
##   ..$ hjust        : num 0.5
##   ..$ vjust        : NULL
##   ..$ angle        : NULL
##   ..$ lineheight   : NULL
##   ..$ margin       : 'margin' num [1:4] 0points 2.2points 0points 2.2points
##   .. ..- attr(*, "unit")= int 8
##   ..$ debug        : NULL
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ axis.ticks                      : list()
##   ..- attr(*, "class")= chr [1:2] "element_blank" "element"
##  $ axis.ticks.x                    : NULL
##  $ axis.ticks.x.top                : NULL
##  $ axis.ticks.x.bottom             : NULL
##  $ axis.ticks.y                    : NULL
##  $ axis.ticks.y.left               : NULL
##  $ axis.ticks.y.right              : NULL
##  $ axis.ticks.theta                : NULL
##  $ axis.ticks.r                    : NULL
##  $ axis.minor.ticks.x.top          : NULL
##  $ axis.minor.ticks.x.bottom       : NULL
##  $ axis.minor.ticks.y.left         : NULL
##  $ axis.minor.ticks.y.right        : NULL
##  $ axis.minor.ticks.theta          : NULL
##  $ axis.minor.ticks.r              : NULL
##  $ axis.ticks.length               : 'simpleUnit' num 2.75points
##   ..- attr(*, "unit")= int 8
##  $ axis.ticks.length.x             : NULL
##  $ axis.ticks.length.x.top         : NULL
##  $ axis.ticks.length.x.bottom      : NULL
##  $ axis.ticks.length.y             : NULL
##  $ axis.ticks.length.y.left        : NULL
##  $ axis.ticks.length.y.right       : NULL
##  $ axis.ticks.length.theta         : NULL
##  $ axis.ticks.length.r             : NULL
##  $ axis.minor.ticks.length         : 'rel' num 0.75
##  $ axis.minor.ticks.length.x       : NULL
##  $ axis.minor.ticks.length.x.top   : NULL
##  $ axis.minor.ticks.length.x.bottom: NULL
##  $ axis.minor.ticks.length.y       : NULL
##  $ axis.minor.ticks.length.y.left  : NULL
##  $ axis.minor.ticks.length.y.right : NULL
##  $ axis.minor.ticks.length.theta   : NULL
##  $ axis.minor.ticks.length.r       : NULL
##  $ axis.line                       : list()
##   ..- attr(*, "class")= chr [1:2] "element_blank" "element"
##  $ axis.line.x                     : NULL
##  $ axis.line.x.top                 : NULL
##  $ axis.line.x.bottom              : NULL
##  $ axis.line.y                     : NULL
##  $ axis.line.y.left                : NULL
##  $ axis.line.y.right               : NULL
##  $ axis.line.theta                 : NULL
##  $ axis.line.r                     : NULL
##  $ legend.background               : list()
##   ..- attr(*, "class")= chr [1:2] "element_blank" "element"
##  $ legend.margin                   : 'margin' num [1:4] 5.5points 5.5points 5.5points 5.5points
##   ..- attr(*, "unit")= int 8
##  $ legend.spacing                  : 'simpleUnit' num 11points
##   ..- attr(*, "unit")= int 8
##  $ legend.spacing.x                : NULL
##  $ legend.spacing.y                : NULL
##  $ legend.key                      : list()
##   ..- attr(*, "class")= chr [1:2] "element_blank" "element"
##  $ legend.key.size                 : 'simpleUnit' num 1.2lines
##   ..- attr(*, "unit")= int 3
##  $ legend.key.height               : NULL
##  $ legend.key.width                : NULL
##  $ legend.key.spacing              : 'simpleUnit' num 5.5points
##   ..- attr(*, "unit")= int 8
##  $ legend.key.spacing.x            : NULL
##  $ legend.key.spacing.y            : NULL
##  $ legend.frame                    : NULL
##  $ legend.ticks                    : NULL
##  $ legend.ticks.length             : 'rel' num 0.2
##  $ legend.axis.line                : NULL
##  $ legend.text                     :List of 11
##   ..$ family       : NULL
##   ..$ face         : NULL
##   ..$ colour       : NULL
##   ..$ size         : 'rel' num 0.8
##   ..$ hjust        : NULL
##   ..$ vjust        : NULL
##   ..$ angle        : NULL
##   ..$ lineheight   : NULL
##   ..$ margin       : NULL
##   ..$ debug        : NULL
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ legend.text.position            : NULL
##  $ legend.title                    :List of 11
##   ..$ family       : NULL
##   ..$ face         : NULL
##   ..$ colour       : NULL
##   ..$ size         : NULL
##   ..$ hjust        : num 0
##   ..$ vjust        : NULL
##   ..$ angle        : NULL
##   ..$ lineheight   : NULL
##   ..$ margin       : NULL
##   ..$ debug        : NULL
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ legend.title.position           : NULL
##  $ legend.position                 : chr "right"
##  $ legend.position.inside          : NULL
##  $ legend.direction                : NULL
##  $ legend.byrow                    : NULL
##  $ legend.justification            : chr "center"
##  $ legend.justification.top        : NULL
##  $ legend.justification.bottom     : NULL
##  $ legend.justification.left       : NULL
##  $ legend.justification.right      : NULL
##  $ legend.justification.inside     : NULL
##  $ legend.location                 : NULL
##  $ legend.box                      : NULL
##  $ legend.box.just                 : NULL
##  $ legend.box.margin               : 'margin' num [1:4] 0cm 0cm 0cm 0cm
##   ..- attr(*, "unit")= int 1
##  $ legend.box.background           : list()
##   ..- attr(*, "class")= chr [1:2] "element_blank" "element"
##  $ legend.box.spacing              : 'simpleUnit' num 11points
##   ..- attr(*, "unit")= int 8
##   [list output truncated]
##  - attr(*, "class")= chr [1:2] "theme" "gg"
##  - attr(*, "complete")= logi TRUE
##  - attr(*, "validate")= logi TRUE

6.4.2 Modelo lineal mixto

library(lme4)

library(lmerTest)

model <- lme4::lmer(formula = ttrans ~ riego * geno + (1|bloque), data = fb)
anova(model)
## Analysis of Variance Table
##            npar Sum Sq Mean Sq  F value
## riego         1 416.31  416.31 325.3217
## geno         14 272.13   19.44  15.1897
## riego:geno   14  29.71    2.12   1.6585

Prueba de normalida

plot(modelo)

Eliminación de datos atípicos

ol <- boxplot(ttrans ~ riego * geno, fb)


ol
## $stats
##       [,1]  [,2]  [,3]  [,4]  [,5]  [,6]   [,7]  [,8]   [,9] [,10] [,11] [,12]
## [1,] 6.388 3.711 6.329 2.863 5.495 3.788  9.341 4.881  7.704 5.023 7.227 3.713
## [2,] 6.420 4.086 6.329 2.904 5.867 3.813  9.341 4.881  8.208 5.023 7.227 3.944
## [3,] 8.321 4.499 6.355 3.538 6.964 3.848 10.045 4.924  9.262 5.066 7.415 4.099
## [4,] 8.388 5.971 6.937 3.547 7.370 4.067 10.188 5.400 10.167 5.159 7.522 4.364
## [5,] 9.430 6.431 7.040 3.831 8.130 4.263 10.396 5.492 11.745 5.159 7.522 4.574
##      [,13] [,14] [,15] [,16]  [,17] [,18] [,19] [,20] [,21] [,22]  [,23] [,24]
## [1,] 1.965 2.196 6.747 3.650  7.890 4.684 3.291 3.499 4.893 2.928  7.921 4.469
## [2,] 2.296 2.196 7.073 3.650  9.759 5.828 5.410 3.565 5.931 2.984  8.823 4.886
## [3,] 2.377 2.212 7.114 4.067 11.010 6.927 5.680 3.671 7.663 4.524  9.288 5.483
## [4,] 4.373 2.397 7.514 4.436 11.212 6.970 7.174 4.121 7.862 4.905 10.363 5.492
## [5,] 5.838 2.525 7.514 4.619 12.296 7.082 8.014 4.121 9.247 5.002 11.320 6.316
##      [,25] [,26] [,27] [,28]  [,29] [,30]
## [1,] 7.666 3.371 7.929 4.416  6.734 4.429
## [2,] 7.942 4.685 8.561 4.701  8.177 5.014
## [3,] 9.237 4.719 9.059 4.970  9.338 5.502
## [4,] 9.245 5.611 9.489 5.789  9.812 6.160
## [5,] 9.355 6.570 9.489 6.066 10.374 6.249
## 
## $n
##  [1] 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5
## 
## $conf
##          [,1]     [,2]     [,3]     [,4]     [,5]     [,6]      [,7]     [,8]
## [1,] 6.930416 3.167064 5.925389 3.083658 5.901984 3.668524  9.446512 4.557276
## [2,] 9.711584 5.830936 6.784611 3.992342 8.026016 4.027476 10.643488 5.290724
##           [,9]    [,10]    [,11]    [,12]    [,13]    [,14]    [,15]    [,16]
## [1,]  7.877776 4.969903 7.206554 3.802229 0.909397 2.069974 6.802391 3.511614
## [2,] 10.646224 5.162097 7.623446 4.395771 3.844603 2.354026 7.425609 4.622386
##          [,17]    [,18]    [,19]    [,20]   [,21]    [,22]    [,23]    [,24]
## [1,]  9.983314 6.120066 4.433562 3.278132 6.29856 3.166626  8.19984 5.054802
## [2,] 12.036686 7.733934 6.926438 4.063868 9.02744 5.881374 10.37616 5.911198
##          [,25]    [,26]    [,27]    [,28]     [,29]    [,30]
## [1,]  8.316303 4.064691 8.403278 4.201222  8.182713 4.692239
## [2,] 10.157697 5.373309 9.714722 5.738778 10.493287 6.311761
## 
## $out
##  [1]  4.137  5.682  3.517  5.881  4.366  6.327 10.269  1.484  8.846  2.424
## [11]  5.626 11.503
## 
## $group
##  [1]  3  7  8 10 10 11 11 14 15 16 20 27
## 
## $names
##  [1] "irrigado.G01" "sequia.G01"   "irrigado.G02" "sequia.G02"   "irrigado.G03"
##  [6] "sequia.G03"   "irrigado.G04" "sequia.G04"   "irrigado.G05" "sequia.G05"  
## [11] "irrigado.G06" "sequia.G06"   "irrigado.G07" "sequia.G07"   "irrigado.G08"
## [16] "sequia.G08"   "irrigado.G09" "sequia.G09"   "irrigado.G10" "sequia.G10"  
## [21] "irrigado.G11" "sequia.G11"   "irrigado.G12" "sequia.G12"   "irrigado.G13"
## [26] "sequia.G13"   "irrigado.G14" "sequia.G14"   "irrigado.G15" "sequia.G15"
library(inti)

model <- remove_outliers(data = fb
                             , formula = ttrans ~ riego * geno + (1|bloque)
                         , plot_diag = T)
model
## $data
## $data$raw
## # A tibble: 150 × 5
##    index riego    geno  bloque ttrans
##    <chr> <chr>    <chr> <chr>   <dbl>
##  1 1     sequia   G01   II       4.50
##  2 2     sequia   G02   IV       3.54
##  3 3     irrigado G01   III      8.39
##  4 4     sequia   G02   I        2.90
##  5 5     irrigado G03   II       7.37
##  6 6     irrigado G04   V       10.0 
##  7 7     irrigado G01   I        6.39
##  8 8     irrigado G05   IV       9.26
##  9 9     sequia   G06   II       4.36
## 10 10    sequia   G05   I        5.16
## # ℹ 140 more rows
## 
## $data$clean
##     index    riego geno bloque ttrans
## 1       1   sequia  G01     II  4.499
## 2       2   sequia  G02     IV  3.538
## 3       3 irrigado  G01    III  8.388
## 4       4   sequia  G02      I  2.904
## 5       5 irrigado  G03     II  7.370
## 6       6 irrigado  G04      V 10.045
## 7       7 irrigado  G01      I  6.388
## 8       8 irrigado  G05     IV  9.262
## 9       9   sequia  G06     II  4.364
## 10     10   sequia  G05      I  5.159
## 11     11 irrigado  G01     II  8.321
## 12     12   sequia  G07     II  2.525
## 13     13 irrigado  G08     II  6.747
## 14     14 irrigado  G06    III  7.522
## 15     15 irrigado  G09    III 11.010
## 16     16 irrigado  G10     II  5.410
## 17     17   sequia  G11      I  5.002
## 18     18   sequia  G12    III  4.469
## 19     19 irrigado  G07      I  2.377
## 20     20 irrigado  G04     II  9.341
## 21     21 irrigado  G13     II  9.245
## 22     22 irrigado  G14    III  7.929
## 23     23 irrigado  G04     IV 10.188
## 24     24   sequia  G04      V  3.517
## 25     25   sequia  G08      V  3.650
## 26     26   sequia  G04    III  4.881
## 27     27   sequia  G01     IV  5.971
## 28     28 irrigado  G10      I  5.680
## 29     29 irrigado  G08      V  7.073
## 30     30 irrigado  G02      V  6.329
## 31     31 irrigado  G07    III  5.838
## 32     32 irrigado  G08      I  7.514
## 33     33 irrigado  G14      V 11.503
## 34     34 irrigado  G03      I  5.867
## 35     35   sequia  G13    III  3.371
## 36     36   sequia  G01      V  4.086
## 37     37   sequia  G03      I  3.848
## 38     38 irrigado  G15    III 10.374
## 39     39 irrigado  G03     IV  8.130
## 40     40 irrigado  G09     IV 12.296
## 41     41 irrigado  G11     II  4.893
## 42     42   sequia  G03      V  3.788
## 43     43   sequia  G11    III  4.524
## 44     44 irrigado  G06      V  7.227
## 45     45   sequia  G05      V  5.881
## 46     46   sequia  G08     IV  4.436
## 47     47 irrigado  G11     IV  9.247
## 48     48   sequia  G11     II  2.984
## 49     49 irrigado  G10    III  8.014
## 50     50   sequia  G06     IV  4.574
## 51     51   sequia  G09      I  4.684
## 52     52 irrigado  G11      I  5.931
## 53     53   sequia  G11     IV  4.905
## 54     54 irrigado  G15     IV  6.734
## 55     55 irrigado  G13     IV  9.355
## 56     56   sequia  G14      V  4.970
## 57     57 irrigado  G02     IV  7.040
## 58     58 irrigado  G09     II 11.212
## 59     59 irrigado  G02    III  6.355
## 60     60   sequia  G08    III  4.619
## 61     61 irrigado  G06     II  6.327
## 62     62   sequia  G13     IV  4.685
## 63     63   sequia  G14    III  4.701
## 64     64   sequia  G04     II  5.492
## 65     65 irrigado  G11    III  7.862
## 66     66 irrigado  G07     II  1.965
## 67     67 irrigado  G08     IV  7.114
## 68     68   sequia  G05     IV  4.366
## 69     69 irrigado  G04      I  5.682
## 70     70 irrigado  G11      V  7.663
## 71     71 irrigado  G12      I  8.823
## 72     72   sequia  G14     IV  5.789
## 73     73   sequia  G07    III  2.397
## 74     74 irrigado  G03    III  5.495
## 75     75   sequia  G01      I  3.711
## 76     76   sequia  G04      I  5.400
## 77     77   sequia  G03     II  4.263
## 78     78 irrigado  G15     II  9.812
## 79     79   sequia  G12     IV  5.492
## 80     80   sequia  G12      I  4.886
## 81     81   sequia  G08      I  2.424
## 82     82   sequia  G05     II  5.066
## 83     83   sequia  G02     II  2.863
## 84     84   sequia  G10      I  3.565
## 85     85   sequia  G15      I  6.249
## 86     86 irrigado  G07      V  2.296
## 87     87   sequia  G10      V  3.499
## 88     88   sequia  G13     II  5.611
## 89     89   sequia  G07      V  2.212
## 90     90   sequia  G03    III  3.813
## 91     91   sequia  G15     IV  5.502
## 92     92   sequia  G13      I  6.570
## 93     93   sequia  G03     IV  4.067
## 94     94 irrigado  G10      V  7.174
## 95     95   sequia  G13      V  4.719
## 96     96   sequia  G09     II  7.082
## 97     97 irrigado  G14     IV  9.489
## 98     98 irrigado  G01      V  6.420
## 99     99   sequia  G01    III  6.431
## 100   100 irrigado  G06     IV 10.269
## 101   101   sequia  G04     IV  4.924
## 102   102 irrigado  G15      V  8.177
## 103   103 irrigado  G13    III  7.666
## 104   104 irrigado  G02     II  6.937
## 105   105   sequia  G08     II  4.067
## 106   106 irrigado  G04    III 10.396
## 107   107   sequia  G02      V  3.547
## 108   108   sequia  G06      V  3.713
## 109   109 irrigado  G15      I  9.338
## 110   110 irrigado  G13      V  9.237
## 111   111 irrigado  G05      V  7.704
## 112   112   sequia  G09    III  6.927
## 113   113   sequia  G09      V  5.828
## 114   114   sequia  G10     II  3.671
## 115   115 irrigado  G07     IV  4.373
## 116   116 irrigado  G05      I  8.208
## 117   117 irrigado  G02      I  4.137
## 118   118   sequia  G05    III  5.023
## 119   119 irrigado  G12     II  7.921
## 120   120   sequia  G15    III  5.014
## 121   121 irrigado  G13      I  7.942
## 122   122   sequia  G14     II  6.066
## 123   123   sequia  G12     II  6.316
## 124   124   sequia  G15     II  4.429
## 125   125 irrigado  G09      V  7.890
## 126   126   sequia  G06      I  4.099
## 127   127   sequia  G09     IV  6.970
## 128   128   sequia  G15      V  6.160
## 129   129 irrigado  G14      I  8.561
## 130   130   sequia  G06    III  3.944
## 131   131 irrigado  G01     IV  9.430
## 132   132 irrigado  G12    III 10.363
## 133   133   sequia  G12      V  5.483
## 134   134 irrigado  G12      V 11.320
## 135   135   sequia  G11      V  2.928
## 136   136 irrigado  G12     IV  9.288
## 137   137 irrigado  G09      I  9.759
## 138   138   sequia  G02    III  3.831
## 139   139   sequia  G07      I  2.196
## 140   140 irrigado  G08    III  8.846
## 141   141 irrigado  G06      I  7.415
## 142   142 irrigado  G10     IV  3.291
## 143   143 irrigado  G03      V  6.964
## 144   144   sequia  G07     IV  1.484
## 145   145 irrigado  G05    III 10.167
## 146   146   sequia  G14      I  4.416
## 147   147   sequia  G10    III  5.626
## 148   148 irrigado  G14     II  9.059
## 149   149 irrigado  G05     II 11.745
## 150   150   sequia  G10     IV  4.121
## 
## 
## $outliers
##  [1] index       riego       geno        bloque      ttrans      resi       
##  [7] res_MAD     rawp.BHStud adjp        bholm       out_flag   
## <0 rows> (o 0- extensión row.names)
## 
## $diagplot

## 
## $model
## $model$raw
## Linear mixed model fit by REML ['lmerMod']
## Formula: ttrans ~ riego * geno + (1 | bloque)
##    Data: rawdt
## REML criterion at convergence: 423.3364
## Random effects:
##  Groups   Name        Std.Dev.
##  bloque   (Intercept) 0.321   
##  Residual             1.131   
## Number of obs: 150, groups:  bloque, 5
## Fixed Effects:
##         (Intercept)          riegosequia              genoG02  
##              7.7894              -2.8498              -1.6298  
##             genoG03              genoG04              genoG05  
##             -1.0242               1.3410               1.6278  
##             genoG06              genoG07              genoG08  
##             -0.0374              -4.4196              -0.3306  
##             genoG09              genoG10              genoG11  
##              2.6440              -1.8756              -0.6702  
##             genoG12              genoG13              genoG14  
##              1.7536               0.8996               1.5188  
##             genoG15  riegosequia:genoG02  riegosequia:genoG03  
##              1.0976               0.0268               0.0404  
## riegosequia:genoG04  riegosequia:genoG05  riegosequia:genoG06  
##             -1.4378              -1.4684              -0.7634  
## riegosequia:genoG07  riegosequia:genoG08  riegosequia:genoG09  
##              1.6428              -0.7698              -1.2854  
## riegosequia:genoG10  riegosequia:genoG11  riegosequia:genoG12  
##              1.0324              -0.2008              -1.3640  
## riegosequia:genoG13  riegosequia:genoG14  riegosequia:genoG15  
##             -0.8480              -1.2700              -0.5664  
## 
## $model$clean
## Linear mixed model fit by REML ['lmerMod']
## Formula: ttrans ~ riego * geno + (1 | bloque)
##    Data: cleandt
## REML criterion at convergence: 423.3364
## Random effects:
##  Groups   Name        Std.Dev.
##  bloque   (Intercept) 0.321   
##  Residual             1.131   
## Number of obs: 150, groups:  bloque, 5
## Fixed Effects:
##         (Intercept)          riegosequia              genoG02  
##              7.7894              -2.8498              -1.6298  
##             genoG03              genoG04              genoG05  
##             -1.0242               1.3410               1.6278  
##             genoG06              genoG07              genoG08  
##             -0.0374              -4.4196              -0.3306  
##             genoG09              genoG10              genoG11  
##              2.6440              -1.8756              -0.6702  
##             genoG12              genoG13              genoG14  
##              1.7536               0.8996               1.5188  
##             genoG15  riegosequia:genoG02  riegosequia:genoG03  
##              1.0976               0.0268               0.0404  
## riegosequia:genoG04  riegosequia:genoG05  riegosequia:genoG06  
##             -1.4378              -1.4684              -0.7634  
## riegosequia:genoG07  riegosequia:genoG08  riegosequia:genoG09  
##              1.6428              -0.7698              -1.2854  
## riegosequia:genoG10  riegosequia:genoG11  riegosequia:genoG12  
##              1.0324              -0.2008              -1.3640  
## riegosequia:genoG13  riegosequia:genoG14  riegosequia:genoG15  
##             -0.8480              -1.2700              -0.5664

Comparación de medias

library(agricolae)
library(tidyverse)
tukey_interaccion <- HSD.test(modelo, c("riego","geno"), group = TRUE)
print(tukey_interaccion)
## $statistics
##    MSerror  Df     Mean       CV      MSD
##   1.279687 116 6.183113 18.29552 2.751186
## 
## $parameters
##    test     name.t ntr StudentizedRange alpha
##   Tukey riego:geno  30         5.438172  0.05
## 
## $means
##               ttrans       std r        se   Min    Max   Q25    Q50    Q75
## irrigado:G01  7.7894 1.3389984 5 0.5059026 6.388  9.430 6.420  8.321  8.388
## irrigado:G02  6.1596 1.1765674 5 0.5059026 4.137  7.040 6.329  6.355  6.937
## irrigado:G03  6.7652 1.0826074 5 0.5059026 5.495  8.130 5.867  6.964  7.370
## irrigado:G04  9.1304 1.9680301 5 0.5059026 5.682 10.396 9.341 10.045 10.188
## irrigado:G05  9.4172 1.6126189 5 0.5059026 7.704 11.745 8.208  9.262 10.167
## irrigado:G06  7.7520 1.4839144 5 0.5059026 6.327 10.269 7.227  7.415  7.522
## irrigado:G07  3.3698 1.6741104 5 0.5059026 1.965  5.838 2.296  2.377  4.373
## irrigado:G08  7.4588 0.8218514 5 0.5059026 6.747  8.846 7.073  7.114  7.514
## irrigado:G09 10.4334 1.6831268 5 0.5059026 7.890 12.296 9.759 11.010 11.212
## irrigado:G10  5.9138 1.8156611 5 0.5059026 3.291  8.014 5.410  5.680  7.174
## irrigado:G11  7.1192 1.7133876 5 0.5059026 4.893  9.247 5.931  7.663  7.862
## irrigado:G12  9.5430 1.3270680 5 0.5059026 7.921 11.320 8.823  9.288 10.363
## irrigado:G13  8.6890 0.8150972 5 0.5059026 7.666  9.355 7.942  9.237  9.245
## irrigado:G14  9.3082 1.3576116 5 0.5059026 7.929 11.503 8.561  9.059  9.489
## irrigado:G15  8.8870 1.4499745 5 0.5059026 6.734 10.374 8.177  9.338  9.812
## sequia:G01    4.9396 1.1958553 5 0.5059026 3.711  6.431 4.086  4.499  5.971
## sequia:G02    3.3366 0.4303200 5 0.5059026 2.863  3.831 2.904  3.538  3.547
## sequia:G03    3.9558 0.2042711 5 0.5059026 3.788  4.263 3.813  3.848  4.067
## sequia:G04    4.8428 0.7902105 5 0.5059026 3.517  5.492 4.881  4.924  5.400
## sequia:G05    5.0990 0.5383489 5 0.5059026 4.366  5.881 5.023  5.066  5.159
## sequia:G06    4.1388 0.3394668 5 0.5059026 3.713  4.574 3.944  4.099  4.364
## sequia:G07    2.1628 0.4032155 5 0.5059026 1.484  2.525 2.196  2.212  2.397
## sequia:G08    3.8392 0.8738906 5 0.5059026 2.424  4.619 3.650  4.067  4.436
## sequia:G09    6.2982 1.0353474 5 0.5059026 4.684  7.082 5.828  6.927  6.970
## sequia:G10    4.0964 0.8888925 5 0.5059026 3.499  5.626 3.565  3.671  4.121
## sequia:G11    4.0686 1.0314450 5 0.5059026 2.928  5.002 2.984  4.524  4.905
## sequia:G12    5.3292 0.7000541 5 0.5059026 4.469  6.316 4.886  5.483  5.492
## sequia:G13    4.9912 1.1905525 5 0.5059026 3.371  6.570 4.685  4.719  5.611
## sequia:G14    5.1884 0.7093591 5 0.5059026 4.416  6.066 4.701  4.970  5.789
## sequia:G15    5.4708 0.7706456 5 0.5059026 4.429  6.249 5.014  5.502  6.160
## 
## $comparison
## NULL
## 
## $groups
##               ttrans groups
## irrigado:G09 10.4334      a
## irrigado:G12  9.5430     ab
## irrigado:G05  9.4172    abc
## irrigado:G14  9.3082    abc
## irrigado:G04  9.1304    abc
## irrigado:G15  8.8870   abcd
## irrigado:G13  8.6890   abcd
## irrigado:G01  7.7894  abcde
## irrigado:G06  7.7520  abcde
## irrigado:G08  7.4588  bcdef
## irrigado:G11  7.1192  bcdef
## irrigado:G03  6.7652  cdefg
## sequia:G09    6.2982  defgh
## irrigado:G02  6.1596  defgh
## irrigado:G10  5.9138  efghi
## sequia:G15    5.4708  efghi
## sequia:G12    5.3292  efghi
## sequia:G14    5.1884  efghi
## sequia:G05    5.0990  efghi
## sequia:G13    4.9912   fghi
## sequia:G01    4.9396   fghi
## sequia:G04    4.8428  fghij
## sequia:G06    4.1388   ghij
## sequia:G10    4.0964   ghij
## sequia:G11    4.0686   ghij
## sequia:G03    3.9558    hij
## sequia:G08    3.8392    hij
## irrigado:G07  3.3698     ij
## sequia:G02    3.3366     ij
## sequia:G07    2.1628      j
## 
## attr(,"class")
## [1] "group"
plot(tukey_interaccion)


str(tukey_interaccion)
## List of 5
##  $ statistics:'data.frame':  1 obs. of  5 variables:
##   ..$ MSerror: num 1.28
##   ..$ Df     : int 116
##   ..$ Mean   : num 6.18
##   ..$ CV     : num 18.3
##   ..$ MSD    : num 2.75
##  $ parameters:'data.frame':  1 obs. of  5 variables:
##   ..$ test            : chr "Tukey"
##   ..$ name.t          : chr "riego:geno"
##   ..$ ntr             : int 30
##   ..$ StudentizedRange: num 5.44
##   ..$ alpha           : num 0.05
##  $ means     :'data.frame':  30 obs. of  9 variables:
##   ..$ ttrans: num [1:30] 7.79 6.16 6.77 9.13 9.42 ...
##   ..$ std   : num [1:30] 1.34 1.18 1.08 1.97 1.61 ...
##   ..$ r     : int [1:30] 5 5 5 5 5 5 5 5 5 5 ...
##   ..$ se    : num [1:30] 0.506 0.506 0.506 0.506 0.506 ...
##   ..$ Min   : num [1:30] 6.39 4.14 5.5 5.68 7.7 ...
##   ..$ Max   : num [1:30] 9.43 7.04 8.13 10.4 11.74 ...
##   ..$ Q25   : num [1:30] 6.42 6.33 5.87 9.34 8.21 ...
##   ..$ Q50   : num [1:30] 8.32 6.36 6.96 10.04 9.26 ...
##   ..$ Q75   : num [1:30] 8.39 6.94 7.37 10.19 10.17 ...
##  $ comparison: NULL
##  $ groups    :'data.frame':  30 obs. of  2 variables:
##   ..$ ttrans: num [1:30] 10.43 9.54 9.42 9.31 9.13 ...
##   ..$ groups: chr [1:30] "a" "ab" "abc" "abc" ...
##  - attr(*, "class")= chr "group"

grupos <- tukey_interaccion$groups %>% 
  rownames_to_column("Tratamientos") %>% 
  separate("Tratamientos", into = c("riego","geno"))

str(grupos)
## 'data.frame':    30 obs. of  4 variables:
##  $ riego : chr  "irrigado" "irrigado" "irrigado" "irrigado" ...
##  $ geno  : chr  "G09" "G12" "G05" "G14" ...
##  $ ttrans: num  10.43 9.54 9.42 9.31 9.13 ...
##  $ groups: chr  "a" "ab" "abc" "abc" ...
ggplot(grupos, aes(x = geno, y = ttrans, fill = riego)) +
  geom_bar(stat = "identity", position = position_dodge()) +
  geom_text(aes(label = groups), 
            position = position_dodge(width = 0.9), 
            vjust = -0.3, 
            size = 3) +  
  labs(title = "Efecto de Geno y Riego en TTRANS",
       x = "Genotipo",
       y = "TTRANS") +
  theme_minimal() +
  scale_fill_discrete(name = "Riego") +
  theme(axis.text.x = element_text(angle = 45, hjust = 1))

6.5 Eficiencia del uso del agua (g/l)

6.5.1 Modelo lineal de wue

ANOVA

modelo <- aov(formula = wue  ~  bloque + riego + geno + riego*geno
          , data = fb)

anova(modelo)
## Analysis of Variance Table
## 
## Response: wue
##             Df  Sum Sq Mean Sq F value          Pr(>F)    
## bloque       4  14.723   3.681  1.4539          0.2208    
## riego        1 118.465 118.465 46.7921 0.0000000003932 ***
## geno        14 123.100   8.793  3.4731 0.0000983737679 ***
## riego:geno  14  28.790   2.056  0.8123          0.6544    
## Residuals  116 293.680   2.532                            
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Prueba de normalidad

plot(modelo)

Interacción de niveles de riego y Geno

library(ggplot2)
ggplot(fb, aes(x = geno, y = wue , colour = riego)) +
  geom_boxplot(outlier.colour = "red", outlier.shape = 16, outlier.size = 2) +
  labs(title = "Boxplot con interacción de niveles de riego y genotipo",
       x = "Interacción Riego y Genotipo",
       y = "Eficiencia del uso del agua (g/l)")

  theme_minimal() +
  theme(axis.text.x = element_text(angle = 45, hjust = 1))  # Inclinar etiquetas del eje X
## List of 136
##  $ line                            :List of 6
##   ..$ colour       : chr "black"
##   ..$ linewidth    : num 0.5
##   ..$ linetype     : num 1
##   ..$ lineend      : chr "butt"
##   ..$ arrow        : logi FALSE
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_line" "element"
##  $ rect                            :List of 5
##   ..$ fill         : chr "white"
##   ..$ colour       : chr "black"
##   ..$ linewidth    : num 0.5
##   ..$ linetype     : num 1
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_rect" "element"
##  $ text                            :List of 11
##   ..$ family       : chr ""
##   ..$ face         : chr "plain"
##   ..$ colour       : chr "black"
##   ..$ size         : num 11
##   ..$ hjust        : num 0.5
##   ..$ vjust        : num 0.5
##   ..$ angle        : num 0
##   ..$ lineheight   : num 0.9
##   ..$ margin       : 'margin' num [1:4] 0points 0points 0points 0points
##   .. ..- attr(*, "unit")= int 8
##   ..$ debug        : logi FALSE
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ title                           : NULL
##  $ aspect.ratio                    : NULL
##  $ axis.title                      : NULL
##  $ axis.title.x                    :List of 11
##   ..$ family       : NULL
##   ..$ face         : NULL
##   ..$ colour       : NULL
##   ..$ size         : NULL
##   ..$ hjust        : NULL
##   ..$ vjust        : num 1
##   ..$ angle        : NULL
##   ..$ lineheight   : NULL
##   ..$ margin       : 'margin' num [1:4] 2.75points 0points 0points 0points
##   .. ..- attr(*, "unit")= int 8
##   ..$ debug        : NULL
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ axis.title.x.top                :List of 11
##   ..$ family       : NULL
##   ..$ face         : NULL
##   ..$ colour       : NULL
##   ..$ size         : NULL
##   ..$ hjust        : NULL
##   ..$ vjust        : num 0
##   ..$ angle        : NULL
##   ..$ lineheight   : NULL
##   ..$ margin       : 'margin' num [1:4] 0points 0points 2.75points 0points
##   .. ..- attr(*, "unit")= int 8
##   ..$ debug        : NULL
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ axis.title.x.bottom             : NULL
##  $ axis.title.y                    :List of 11
##   ..$ family       : NULL
##   ..$ face         : NULL
##   ..$ colour       : NULL
##   ..$ size         : NULL
##   ..$ hjust        : NULL
##   ..$ vjust        : num 1
##   ..$ angle        : num 90
##   ..$ lineheight   : NULL
##   ..$ margin       : 'margin' num [1:4] 0points 2.75points 0points 0points
##   .. ..- attr(*, "unit")= int 8
##   ..$ debug        : NULL
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ axis.title.y.left               : NULL
##  $ axis.title.y.right              :List of 11
##   ..$ family       : NULL
##   ..$ face         : NULL
##   ..$ colour       : NULL
##   ..$ size         : NULL
##   ..$ hjust        : NULL
##   ..$ vjust        : num 1
##   ..$ angle        : num -90
##   ..$ lineheight   : NULL
##   ..$ margin       : 'margin' num [1:4] 0points 0points 0points 2.75points
##   .. ..- attr(*, "unit")= int 8
##   ..$ debug        : NULL
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ axis.text                       :List of 11
##   ..$ family       : NULL
##   ..$ face         : NULL
##   ..$ colour       : chr "grey30"
##   ..$ size         : 'rel' num 0.8
##   ..$ hjust        : NULL
##   ..$ vjust        : NULL
##   ..$ angle        : NULL
##   ..$ lineheight   : NULL
##   ..$ margin       : NULL
##   ..$ debug        : NULL
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ axis.text.x                     :List of 11
##   ..$ family       : NULL
##   ..$ face         : NULL
##   ..$ colour       : NULL
##   ..$ size         : NULL
##   ..$ hjust        : num 1
##   ..$ vjust        : num 1
##   ..$ angle        : num 45
##   ..$ lineheight   : NULL
##   ..$ margin       : 'margin' num [1:4] 2.2points 0points 0points 0points
##   .. ..- attr(*, "unit")= int 8
##   ..$ debug        : NULL
##   ..$ inherit.blank: logi FALSE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ axis.text.x.top                 :List of 11
##   ..$ family       : NULL
##   ..$ face         : NULL
##   ..$ colour       : NULL
##   ..$ size         : NULL
##   ..$ hjust        : NULL
##   ..$ vjust        : num 0
##   ..$ angle        : NULL
##   ..$ lineheight   : NULL
##   ..$ margin       : 'margin' num [1:4] 0points 0points 2.2points 0points
##   .. ..- attr(*, "unit")= int 8
##   ..$ debug        : NULL
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ axis.text.x.bottom              : NULL
##  $ axis.text.y                     :List of 11
##   ..$ family       : NULL
##   ..$ face         : NULL
##   ..$ colour       : NULL
##   ..$ size         : NULL
##   ..$ hjust        : num 1
##   ..$ vjust        : NULL
##   ..$ angle        : NULL
##   ..$ lineheight   : NULL
##   ..$ margin       : 'margin' num [1:4] 0points 2.2points 0points 0points
##   .. ..- attr(*, "unit")= int 8
##   ..$ debug        : NULL
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ axis.text.y.left                : NULL
##  $ axis.text.y.right               :List of 11
##   ..$ family       : NULL
##   ..$ face         : NULL
##   ..$ colour       : NULL
##   ..$ size         : NULL
##   ..$ hjust        : num 0
##   ..$ vjust        : NULL
##   ..$ angle        : NULL
##   ..$ lineheight   : NULL
##   ..$ margin       : 'margin' num [1:4] 0points 0points 0points 2.2points
##   .. ..- attr(*, "unit")= int 8
##   ..$ debug        : NULL
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ axis.text.theta                 : NULL
##  $ axis.text.r                     :List of 11
##   ..$ family       : NULL
##   ..$ face         : NULL
##   ..$ colour       : NULL
##   ..$ size         : NULL
##   ..$ hjust        : num 0.5
##   ..$ vjust        : NULL
##   ..$ angle        : NULL
##   ..$ lineheight   : NULL
##   ..$ margin       : 'margin' num [1:4] 0points 2.2points 0points 2.2points
##   .. ..- attr(*, "unit")= int 8
##   ..$ debug        : NULL
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ axis.ticks                      : list()
##   ..- attr(*, "class")= chr [1:2] "element_blank" "element"
##  $ axis.ticks.x                    : NULL
##  $ axis.ticks.x.top                : NULL
##  $ axis.ticks.x.bottom             : NULL
##  $ axis.ticks.y                    : NULL
##  $ axis.ticks.y.left               : NULL
##  $ axis.ticks.y.right              : NULL
##  $ axis.ticks.theta                : NULL
##  $ axis.ticks.r                    : NULL
##  $ axis.minor.ticks.x.top          : NULL
##  $ axis.minor.ticks.x.bottom       : NULL
##  $ axis.minor.ticks.y.left         : NULL
##  $ axis.minor.ticks.y.right        : NULL
##  $ axis.minor.ticks.theta          : NULL
##  $ axis.minor.ticks.r              : NULL
##  $ axis.ticks.length               : 'simpleUnit' num 2.75points
##   ..- attr(*, "unit")= int 8
##  $ axis.ticks.length.x             : NULL
##  $ axis.ticks.length.x.top         : NULL
##  $ axis.ticks.length.x.bottom      : NULL
##  $ axis.ticks.length.y             : NULL
##  $ axis.ticks.length.y.left        : NULL
##  $ axis.ticks.length.y.right       : NULL
##  $ axis.ticks.length.theta         : NULL
##  $ axis.ticks.length.r             : NULL
##  $ axis.minor.ticks.length         : 'rel' num 0.75
##  $ axis.minor.ticks.length.x       : NULL
##  $ axis.minor.ticks.length.x.top   : NULL
##  $ axis.minor.ticks.length.x.bottom: NULL
##  $ axis.minor.ticks.length.y       : NULL
##  $ axis.minor.ticks.length.y.left  : NULL
##  $ axis.minor.ticks.length.y.right : NULL
##  $ axis.minor.ticks.length.theta   : NULL
##  $ axis.minor.ticks.length.r       : NULL
##  $ axis.line                       : list()
##   ..- attr(*, "class")= chr [1:2] "element_blank" "element"
##  $ axis.line.x                     : NULL
##  $ axis.line.x.top                 : NULL
##  $ axis.line.x.bottom              : NULL
##  $ axis.line.y                     : NULL
##  $ axis.line.y.left                : NULL
##  $ axis.line.y.right               : NULL
##  $ axis.line.theta                 : NULL
##  $ axis.line.r                     : NULL
##  $ legend.background               : list()
##   ..- attr(*, "class")= chr [1:2] "element_blank" "element"
##  $ legend.margin                   : 'margin' num [1:4] 5.5points 5.5points 5.5points 5.5points
##   ..- attr(*, "unit")= int 8
##  $ legend.spacing                  : 'simpleUnit' num 11points
##   ..- attr(*, "unit")= int 8
##  $ legend.spacing.x                : NULL
##  $ legend.spacing.y                : NULL
##  $ legend.key                      : list()
##   ..- attr(*, "class")= chr [1:2] "element_blank" "element"
##  $ legend.key.size                 : 'simpleUnit' num 1.2lines
##   ..- attr(*, "unit")= int 3
##  $ legend.key.height               : NULL
##  $ legend.key.width                : NULL
##  $ legend.key.spacing              : 'simpleUnit' num 5.5points
##   ..- attr(*, "unit")= int 8
##  $ legend.key.spacing.x            : NULL
##  $ legend.key.spacing.y            : NULL
##  $ legend.frame                    : NULL
##  $ legend.ticks                    : NULL
##  $ legend.ticks.length             : 'rel' num 0.2
##  $ legend.axis.line                : NULL
##  $ legend.text                     :List of 11
##   ..$ family       : NULL
##   ..$ face         : NULL
##   ..$ colour       : NULL
##   ..$ size         : 'rel' num 0.8
##   ..$ hjust        : NULL
##   ..$ vjust        : NULL
##   ..$ angle        : NULL
##   ..$ lineheight   : NULL
##   ..$ margin       : NULL
##   ..$ debug        : NULL
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ legend.text.position            : NULL
##  $ legend.title                    :List of 11
##   ..$ family       : NULL
##   ..$ face         : NULL
##   ..$ colour       : NULL
##   ..$ size         : NULL
##   ..$ hjust        : num 0
##   ..$ vjust        : NULL
##   ..$ angle        : NULL
##   ..$ lineheight   : NULL
##   ..$ margin       : NULL
##   ..$ debug        : NULL
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ legend.title.position           : NULL
##  $ legend.position                 : chr "right"
##  $ legend.position.inside          : NULL
##  $ legend.direction                : NULL
##  $ legend.byrow                    : NULL
##  $ legend.justification            : chr "center"
##  $ legend.justification.top        : NULL
##  $ legend.justification.bottom     : NULL
##  $ legend.justification.left       : NULL
##  $ legend.justification.right      : NULL
##  $ legend.justification.inside     : NULL
##  $ legend.location                 : NULL
##  $ legend.box                      : NULL
##  $ legend.box.just                 : NULL
##  $ legend.box.margin               : 'margin' num [1:4] 0cm 0cm 0cm 0cm
##   ..- attr(*, "unit")= int 1
##  $ legend.box.background           : list()
##   ..- attr(*, "class")= chr [1:2] "element_blank" "element"
##  $ legend.box.spacing              : 'simpleUnit' num 11points
##   ..- attr(*, "unit")= int 8
##   [list output truncated]
##  - attr(*, "class")= chr [1:2] "theme" "gg"
##  - attr(*, "complete")= logi TRUE
##  - attr(*, "validate")= logi TRUE

6.5.2 Modelo lineal mixto

library(lme4)

library(lmerTest)

model <- lme4::lmer(formula = wue ~ riego * geno + (1|bloque), data = fb)
anova(model)
## Analysis of Variance Table
##            npar Sum Sq Mean Sq F value
## riego         1 118.47 118.465 46.7921
## geno         14 123.10   8.793  3.4731
## riego:geno   14  28.79   2.056  0.8123

Prueba de normalida

plot(modelo)

Eliminación de datos atípicos

ol <- boxplot(wue ~ riego * geno, fb)


ol
## $stats
##          [,1]     [,2]     [,3]     [,4]     [,5]     [,6]      [,7]     [,8]
## [1,] 8.949099 10.21437 8.368383 10.58330 10.38035 12.59897  9.791243 10.37963
## [2,] 8.949099 10.39881 8.477273 10.58330 10.38035 12.74325  9.791243 10.40787
## [3,] 9.026480 10.77126 8.624766 10.65083 10.58587 12.75871  9.971535 10.73517
## [4,] 9.090254 11.15272 8.833989 10.68966 10.87653 13.04314 10.214037 11.61033
## [5,] 9.090254 11.50922 8.833989 10.71783 10.87653 13.32864 10.214037 12.57606
##          [,9]    [,10]     [,11]    [,12]    [,13]     [,14]    [,15]     [,16]
## [1,] 8.333333 10.50567  8.821308 10.59077 7.484224  8.479053 8.291883  9.957169
## [2,] 8.705867 10.50567  8.906877 10.59077 7.931185  9.703504 8.381688  9.957169
## [3,] 9.407407 10.91878  9.459459 10.87582 8.381679  9.923146 8.821699  9.968035
## [4,] 9.665299 11.13926  9.990694 10.88222 8.999657 11.584158 9.020218 10.222992
## [5,] 9.816072 11.13926 10.076931 10.88222 8.999657 11.827284 9.645769 10.222992
##          [,17]    [,18]     [,19]     [,20]    [,21]    [,22]    [,23]
## [1,]  8.536735 10.39960  7.848592  9.774262 11.72126 13.00888 8.644488
## [2,]  8.995459 10.82287  8.153053 10.296045 11.72126 13.00888 8.761520
## [3,] 10.354085 11.12052  8.449168 11.035140 11.87411 13.05199 9.234982
## [4,] 10.792128 11.30444 10.247068 11.848527 12.12780 13.07277 9.522838
## [5,] 11.979721 11.30444 10.680644 13.621035 12.13940 13.13439 9.567693
##          [,24]    [,25]     [,26]    [,27]    [,28]    [,29]    [,30]
## [1,]  8.996723 8.044820  8.490465 9.203364 11.82089 10.42510 11.83885
## [2,]  9.126391 8.044820  8.500761 9.203364 11.82089 10.64598 11.92112
## [3,]  9.726092 8.192410  9.850587 9.269235 11.83197 10.91240 12.01174
## [4,] 10.217051 8.329136 10.821715 9.330609 11.87108 11.16796 12.09474
## [5,] 11.348752 8.329136 11.438864 9.330609 11.87108 11.78305 12.27110
## 
## $n
##  [1] 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5
## 
## $conf
##          [,1]     [,2]     [,3]     [,4]     [,5]     [,6]     [,7]     [,8]
## [1,] 8.926740 10.23856 8.372711 10.57568 10.23527 12.54681  9.67279  9.88552
## [2,] 9.126219 11.30397 8.876821 10.72597 10.93647 12.97062 10.27028 11.58483
##           [,9]    [,10]     [,11]    [,12]    [,13]     [,14]    [,15]
## [1,]  8.729475 10.47109  8.693637 10.66989 7.626699  8.594281 8.370515
## [2,] 10.085340 11.36647 10.225282 11.08176 9.136660 11.252012 9.272882
##          [,16]     [,17]    [,18]    [,19]    [,20]    [,21]    [,22]    [,23]
## [1,]  9.780205  9.084563 10.78024 6.969543  9.93816 11.58684 13.00684 8.697037
## [2,] 10.155866 11.623607 11.46080 9.928794 12.13212 12.16137 13.09713 9.772928
##          [,24]    [,25]     [,26]    [,27]    [,28]    [,29]    [,30]
## [1,]  8.955435 7.991513  8.210607 9.179324 11.79651 10.54357 11.88906
## [2,] 10.496750 8.393308 11.490567 9.359146 11.86744 11.28123 12.13442
## 
## $out
##  [1]  9.965427  8.619286  9.597093  9.489710  9.587523 12.130381  8.454769
##  [8] 11.399577 26.234540  9.216344  9.610844 12.165365 10.658587 11.997260
## [15]  9.207921 12.570350  8.838542 12.272118  7.551109  9.372554  5.979316
## [22] 10.846243 13.100604 10.587321
## 
## $group
##  [1]  1  1  3  4  5  5  7  7 10 10 12 12 13 16 16 18 21 22 25 25 27 27 28 28
## 
## $names
##  [1] "irrigado.G01" "sequia.G01"   "irrigado.G02" "sequia.G02"   "irrigado.G03"
##  [6] "sequia.G03"   "irrigado.G04" "sequia.G04"   "irrigado.G05" "sequia.G05"  
## [11] "irrigado.G06" "sequia.G06"   "irrigado.G07" "sequia.G07"   "irrigado.G08"
## [16] "sequia.G08"   "irrigado.G09" "sequia.G09"   "irrigado.G10" "sequia.G10"  
## [21] "irrigado.G11" "sequia.G11"   "irrigado.G12" "sequia.G12"   "irrigado.G13"
## [26] "sequia.G13"   "irrigado.G14" "sequia.G14"   "irrigado.G15" "sequia.G15"
library(inti)

model <- remove_outliers(data = fb
                             , formula = wue ~ riego * geno + (1|bloque)
                         , plot_diag = T)
model
## $data
## $data$raw
## # A tibble: 150 × 5
##    index riego    geno  bloque   wue
##    <chr> <chr>    <chr> <chr>  <dbl>
##  1 1     sequia   G01   II     11.5 
##  2 2     sequia   G02   IV     10.7 
##  3 3     irrigado G01   III     9.97
##  4 4     sequia   G02   I      10.7 
##  5 5     irrigado G03   II     10.9 
##  6 6     irrigado G04   V      10.2 
##  7 7     irrigado G01   I       8.62
##  8 8     irrigado G05   IV      9.67
##  9 9     sequia   G06   II     10.9 
## 10 10    sequia   G05   I      10.9 
## # ℹ 140 more rows
## 
## $data$clean
##     index    riego geno bloque       wue
## 1       1   sequia  G01     II 11.509224
## 2       2   sequia  G02     IV 10.689655
## 3       3 irrigado  G01    III  9.965427
## 4       4   sequia  G02      I 10.650826
## 5       5 irrigado  G03     II 10.876526
## 6       6 irrigado  G04      V 10.214037
## 7       7 irrigado  G01      I  8.619286
## 8       8 irrigado  G05     IV  9.665299
## 9       9   sequia  G06     II 10.882218
## 10     10   sequia  G05      I 10.918783
## 11     11 irrigado  G01     II  9.090254
## 12     12   sequia  G07     II 11.584158
## 13     13 irrigado  G08     II  8.821699
## 14     14 irrigado  G06    III  9.990694
## 15     15 irrigado  G09    III  8.995459
## 16     16 irrigado  G10     II  8.449168
## 17     17   sequia  G11      I 13.072771
## 18     18   sequia  G12    III 10.217051
## 19     19 irrigado  G07      I  7.484224
## 20     20 irrigado  G04     II  9.791243
## 21     21 irrigado  G13     II  7.551109
## 22     22 irrigado  G14    III        NA
## 23     23 irrigado  G04     IV  9.971535
## 24     24   sequia  G04      V 12.576059
## 25     25   sequia  G08      V 11.997260
## 26     26   sequia  G04    III 11.610326
## 27     27   sequia  G01     IV 10.214369
## 28     28 irrigado  G10      I  7.848592
## 29     29 irrigado  G08      V  9.020218
## 30     30 irrigado  G02      V  9.597093
## 31     31 irrigado  G07    III  8.999657
## 32     32 irrigado  G08      I  8.381688
## 33     33 irrigado  G14      V  9.330609
## 34     34 irrigado  G03      I  9.587523
## 35     35   sequia  G13    III 10.821715
## 36     36   sequia  G01      V 11.152717
## 37     37   sequia  G03      I 13.043139
## 38     38 irrigado  G15    III 10.425101
## 39     39 irrigado  G03     IV 12.130381
## 40     40 irrigado  G09     IV 10.792128
## 41     41 irrigado  G11     II 11.874106
## 42     42   sequia  G03      V 12.758712
## 43     43   sequia  G11    III 13.134394
## 44     44 irrigado  G06      V  8.906877
## 45     45   sequia  G05      V 11.139262
## 46     46   sequia  G08     IV  9.957169
## 47     47 irrigado  G11     IV  8.838542
## 48     48   sequia  G11     II 12.272118
## 49     49 irrigado  G10    III 10.247068
## 50     50   sequia  G06     IV  9.610844
## 51     51   sequia  G09      I 11.304441
## 52     52 irrigado  G11      I 12.127803
## 53     53   sequia  G11     IV 13.051988
## 54     54 irrigado  G15     IV 10.645976
## 55     55 irrigado  G13     IV  8.192410
## 56     56   sequia  G14      V 13.100604
## 57     57 irrigado  G02     IV  8.477273
## 58     58 irrigado  G09     II 10.354085
## 59     59 irrigado  G02    III  8.833989
## 60     60   sequia  G08    III 10.222992
## 61     61 irrigado  G06     II  9.459459
## 62     62   sequia  G13     IV  9.850587
## 63     63   sequia  G14    III 11.820889
## 64     64   sequia  G04     II 10.407866
## 65     65 irrigado  G11    III 12.139405
## 66     66 irrigado  G07     II  8.381679
## 67     67 irrigado  G08     IV  9.645769
## 68     68   sequia  G05     IV        NA
## 69     69 irrigado  G04      I  8.454769
## 70     70 irrigado  G11      V 11.721258
## 71     71 irrigado  G12      I  9.522838
## 72     72   sequia  G14     IV 10.587321
## 73     73   sequia  G07    III 11.827284
## 74     74 irrigado  G03    III 10.380346
## 75     75   sequia  G01      I 10.398814
## 76     76   sequia  G04      I 10.379630
## 77     77   sequia  G03     II 13.328642
## 78     78 irrigado  G15     II 11.167958
## 79     79   sequia  G12     IV  8.996723
## 80     80   sequia  G12      I 11.348752
## 81     81   sequia  G08      I  9.207921
## 82     82   sequia  G05     II        NA
## 83     83   sequia  G02     II 10.583304
## 84     84   sequia  G10      I 11.848527
## 85     85   sequia  G15      I 12.094735
## 86     86 irrigado  G07      V  7.931185
## 87     87   sequia  G10      V 13.621035
## 88     88   sequia  G13     II  8.490465
## 89     89   sequia  G07      V  9.923146
## 90     90   sequia  G03    III 12.743247
## 91     91   sequia  G15     IV 11.921120
## 92     92   sequia  G13      I  8.500761
## 93     93   sequia  G03     IV 12.598967
## 94     94 irrigado  G10      V  8.153053
## 95     95   sequia  G13      V 11.438864
## 96     96   sequia  G09     II 10.399605
## 97     97 irrigado  G14     IV 10.846243
## 98     98 irrigado  G01      V  9.026480
## 99     99   sequia  G01    III 10.771264
## 100   100 irrigado  G06     IV 10.076931
## 101   101   sequia  G04     IV 10.735175
## 102   102 irrigado  G15      V 11.783050
## 103   103 irrigado  G13    III  9.372554
## 104   104 irrigado  G02     II  8.624766
## 105   105   sequia  G08     II  9.968035
## 106   106 irrigado  G04    III 11.399577
## 107   107   sequia  G02      V  9.489710
## 108   108   sequia  G06      V 12.165365
## 109   109 irrigado  G15      I 10.912401
## 110   110 irrigado  G13      V  8.044820
## 111   111 irrigado  G05      V  8.705867
## 112   112   sequia  G09    III 10.822867
## 113   113   sequia  G09      V 12.570350
## 114   114   sequia  G10     II 11.035140
## 115   115 irrigado  G07     IV 10.658587
## 116   116 irrigado  G05      I  8.333333
## 117   117 irrigado  G02      I  8.368383
## 118   118   sequia  G05    III        NA
## 119   119 irrigado  G12     II  8.761520
## 120   120   sequia  G15    III 11.838851
## 121   121 irrigado  G13      I  8.329136
## 122   122   sequia  G14     II 11.871085
## 123   123   sequia  G12     II  9.726092
## 124   124   sequia  G15     II 12.011741
## 125   125 irrigado  G09      V 11.979721
## 126   126   sequia  G06      I 10.875823
## 127   127   sequia  G09     IV 11.120516
## 128   128   sequia  G15      V 12.271104
## 129   129 irrigado  G14      I  9.203364
## 130   130   sequia  G06    III 10.590771
## 131   131 irrigado  G01     IV  8.949099
## 132   132 irrigado  G12    III  9.567693
## 133   133   sequia  G12      V  9.126391
## 134   134 irrigado  G12      V  9.234982
## 135   135   sequia  G11      V 13.008880
## 136   136 irrigado  G12     IV  8.644488
## 137   137 irrigado  G09      I  8.536735
## 138   138   sequia  G02    III 10.717828
## 139   139   sequia  G07      I  8.479053
## 140   140 irrigado  G08    III  8.291883
## 141   141 irrigado  G06      I  8.821308
## 142   142 irrigado  G10     IV 10.680644
## 143   143 irrigado  G03      V 10.585870
## 144   144   sequia  G07     IV  9.703504
## 145   145 irrigado  G05    III  9.816072
## 146   146   sequia  G14      I 11.831975
## 147   147   sequia  G10    III  9.774262
## 148   148 irrigado  G14     II  9.269235
## 149   149 irrigado  G05     II  9.407407
## 150   150   sequia  G10     IV 10.296045
## 
## 
## $outliers
##     index    riego geno bloque       wue      resi   res_MAD       rawp.BHStud
## 22     22 irrigado  G14    III  5.979316 -2.944944 -3.997449 0.000064028709257
## 68     68   sequia  G05     IV 26.234540 12.508652 16.979168 0.000000000000000
## 82     82   sequia  G05     II  9.216344 -4.315805 -5.858247 0.000000004677779
## 118   118   sequia  G05    III 10.505674 -3.095754 -4.202157 0.000026438356298
##                  adjp          bholm out_flag
## 22  0.000064028709257 0.009412220261  OUTLIER
## 68  0.000000000000000 0.000000000000  OUTLIER
## 82  0.000000004677779 0.000000696989  OUTLIER
## 118 0.000026438356298 0.003912876732  OUTLIER
## 
## $diagplot

## 
## $model
## $model$raw
## Linear mixed model fit by REML ['lmerMod']
## Formula: wue ~ riego * geno + (1 | bloque)
##    Data: rawdt
## REML criterion at convergence: 501.7935
## Random effects:
##  Groups   Name        Std.Dev.
##  bloque   (Intercept) 0.1957  
##  Residual             1.5911  
## Number of obs: 150, groups:  bloque, 5
## Fixed Effects:
##         (Intercept)          riegosequia              genoG02  
##             9.13011              1.67917             -0.34981  
##             genoG03              genoG04              genoG05  
##             1.58202              0.83612              0.05549  
##             genoG06              genoG07              genoG08  
##             0.32094             -0.43904             -0.29786  
##             genoG09              genoG10              genoG11  
##             1.00152             -0.05440              2.21011  
##             genoG12              genoG13              genoG14  
##             0.01620             -0.83210             -0.20436  
##             genoG15  riegosequia:genoG02  riegosequia:genoG03  
##             1.85679             -0.03320              0.50324  
## riegosequia:genoG04  riegosequia:genoG05  riegosequia:genoG06  
##            -0.50359              2.73816             -0.30522  
## riegosequia:genoG07  riegosequia:genoG08  riegosequia:genoG09  
##            -0.06681             -0.24074             -0.56724  
## riegosequia:genoG10  riegosequia:genoG11  riegosequia:genoG12  
##             0.56013             -0.11136             -0.94247  
## riegosequia:genoG13  riegosequia:genoG14  riegosequia:genoG15  
##            -0.15670              1.23745             -0.63856  
## 
## $model$clean
## Linear mixed model fit by REML ['lmerMod']
## Formula: wue ~ riego * geno + (1 | bloque)
##    Data: cleandt
## REML criterion at convergence: 350.3855
## Random effects:
##  Groups   Name        Std.Dev.
##  bloque   (Intercept) 0.2400  
##  Residual             0.8765  
## Number of obs: 146, groups:  bloque, 5
## Fixed Effects:
##         (Intercept)          riegosequia              genoG02  
##             9.13011              1.67917             -0.34981  
##             genoG03              genoG04              genoG05  
##             1.58202              0.83612              0.05549  
##             genoG06              genoG07              genoG08  
##             0.32094             -0.43904             -0.29786  
##             genoG09              genoG10              genoG11  
##             1.00152             -0.05440              2.21011  
##             genoG12              genoG13              genoG14  
##             0.01620             -0.83210              0.56793  
##             genoG15  riegosequia:genoG02  riegosequia:genoG03  
##             1.85679             -0.03320              0.50324  
## riegosequia:genoG04  riegosequia:genoG05  riegosequia:genoG06  
##            -0.50359              0.17924             -0.30522  
## riegosequia:genoG07  riegosequia:genoG08  riegosequia:genoG09  
##            -0.06681             -0.24074             -0.56724  
## riegosequia:genoG10  riegosequia:genoG11  riegosequia:genoG12  
##             0.56013             -0.11136             -0.94247  
## riegosequia:genoG13  riegosequia:genoG14  riegosequia:genoG15  
##            -0.15670              0.46516             -0.63856

Comparación de medias

library(agricolae)
library(tidyverse)
tukey_interaccion <- HSD.test(modelo, c("riego","geno"), group = TRUE)
print(tukey_interaccion)
## $statistics
##    MSerror  Df    Mean       CV      MSD
##   2.531726 116 10.3989 15.30103 3.869691
## 
## $parameters
##    test     name.t ntr StudentizedRange alpha
##   Tukey riego:geno  30         5.438172  0.05
## 
## $means
##                    wue       std r        se       Min       Max       Q25
## irrigado:G01  9.130109 0.5009461 5 0.7115794  8.619286  9.965427  8.949099
## irrigado:G02  8.780301 0.4888060 5 0.7115794  8.368383  9.597093  8.477273
## irrigado:G03 10.712129 0.9259084 5 0.7115794  9.587523 12.130381 10.380346
## irrigado:G04  9.966232 1.0525033 5 0.7115794  8.454769 11.399577  9.791243
## irrigado:G05  9.185596 0.6390044 5 0.7115794  8.333333  9.816072  8.705867
## irrigado:G06  9.451054 0.5864537 5 0.7115794  8.821308 10.076931  8.906877
## irrigado:G07  8.691066 1.2345014 5 0.7115794  7.484224 10.658587  7.931185
## irrigado:G08  8.832251 0.5459530 5 0.7115794  8.291883  9.645769  8.381688
## irrigado:G09 10.131626 1.3906616 5 0.7115794  8.536735 11.979721  8.995459
## irrigado:G10  9.075705 1.2939825 5 0.7115794  7.848592 10.680644  8.153053
## irrigado:G11 11.340223 1.4095743 5 0.7115794  8.838542 12.139405 11.721258
## irrigado:G12  9.146304 0.4263475 5 0.7115794  8.644488  9.567693  8.761520
## irrigado:G13  8.298006 0.6687174 5 0.7115794  7.551109  9.372554  8.044820
## irrigado:G14  8.925754 1.7838671 5 0.7115794  5.979316 10.846243  9.203364
## irrigado:G15 10.986897 0.5253651 5 0.7115794 10.425101 11.783050 10.645976
## sequia:G01   10.809278 0.5319108 5 0.7115794 10.214369 11.509224 10.398814
## sequia:G02   10.426265 0.5259773 5 0.7115794  9.489710 10.717828 10.583304
## sequia:G03   12.894541 0.2912165 5 0.7115794 12.598967 13.328642 12.743247
## sequia:G04   11.141811 0.9435998 5 0.7115794 10.379630 12.576059 10.407866
## sequia:G05   13.602921 7.1004753 5 0.7115794  9.216344 26.234540 10.505674
## sequia:G06   10.825004 0.9126162 5 0.7115794  9.610844 12.165365 10.590771
## sequia:G07   10.303429 1.3960010 5 0.7115794  8.479053 11.827284  9.703504
## sequia:G08   10.270675 1.0371468 5 0.7115794  9.207921 11.997260  9.957169
## sequia:G09   11.243556 0.8167713 5 0.7115794 10.399605 12.570350 10.822867
## sequia:G10   11.315002 1.5077227 5 0.7115794  9.774262 13.621035 10.296045
## sequia:G11   12.908030 0.3583500 5 0.7115794 12.272118 13.134394 13.008880
## sequia:G12    9.883002 0.9542776 5 0.7115794  8.996723 11.348752  9.126391
## sequia:G13    9.820478 1.3353971 5 0.7115794  8.490465 11.438864  8.500761
## sequia:G14   11.842375 0.8887765 5 0.7115794 10.587321 13.100604 11.820889
## sequia:G15   12.027510 0.1665960 5 0.7115794 11.838851 12.271104 11.921120
##                    Q50       Q75
## irrigado:G01  9.026480  9.090254
## irrigado:G02  8.624766  8.833989
## irrigado:G03 10.585870 10.876526
## irrigado:G04  9.971535 10.214037
## irrigado:G05  9.407407  9.665299
## irrigado:G06  9.459459  9.990694
## irrigado:G07  8.381679  8.999657
## irrigado:G08  8.821699  9.020218
## irrigado:G09 10.354085 10.792128
## irrigado:G10  8.449168 10.247068
## irrigado:G11 11.874106 12.127803
## irrigado:G12  9.234982  9.522838
## irrigado:G13  8.192410  8.329136
## irrigado:G14  9.269235  9.330609
## irrigado:G15 10.912401 11.167958
## sequia:G01   10.771264 11.152717
## sequia:G02   10.650826 10.689655
## sequia:G03   12.758712 13.043139
## sequia:G04   10.735175 11.610326
## sequia:G05   10.918783 11.139262
## sequia:G06   10.875823 10.882218
## sequia:G07    9.923146 11.584158
## sequia:G08    9.968035 10.222992
## sequia:G09   11.120516 11.304441
## sequia:G10   11.035140 11.848527
## sequia:G11   13.051988 13.072771
## sequia:G12    9.726092 10.217051
## sequia:G13    9.850587 10.821715
## sequia:G14   11.831975 11.871085
## sequia:G15   12.011741 12.094735
## 
## $comparison
## NULL
## 
## $groups
##                    wue groups
## sequia:G05   13.602921      a
## sequia:G11   12.908030     ab
## sequia:G03   12.894541     ab
## sequia:G15   12.027510    abc
## sequia:G14   11.842375    abc
## irrigado:G11 11.340223    abc
## sequia:G10   11.315002    abc
## sequia:G09   11.243556    abc
## sequia:G04   11.141811    abc
## irrigado:G15 10.986897    abc
## sequia:G06   10.825004    abc
## sequia:G01   10.809278    abc
## irrigado:G03 10.712129    abc
## sequia:G02   10.426265    abc
## sequia:G07   10.303429    abc
## sequia:G08   10.270675    abc
## irrigado:G09 10.131626    abc
## irrigado:G04  9.966232    abc
## sequia:G12    9.883002    abc
## sequia:G13    9.820478    abc
## irrigado:G06  9.451054     bc
## irrigado:G05  9.185596     bc
## irrigado:G12  9.146304     bc
## irrigado:G01  9.130109     bc
## irrigado:G10  9.075705     bc
## irrigado:G14  8.925754      c
## irrigado:G08  8.832251      c
## irrigado:G02  8.780301      c
## irrigado:G07  8.691066      c
## irrigado:G13  8.298006      c
## 
## attr(,"class")
## [1] "group"
plot(tukey_interaccion)


str(tukey_interaccion)
## List of 5
##  $ statistics:'data.frame':  1 obs. of  5 variables:
##   ..$ MSerror: num 2.53
##   ..$ Df     : int 116
##   ..$ Mean   : num 10.4
##   ..$ CV     : num 15.3
##   ..$ MSD    : num 3.87
##  $ parameters:'data.frame':  1 obs. of  5 variables:
##   ..$ test            : chr "Tukey"
##   ..$ name.t          : chr "riego:geno"
##   ..$ ntr             : int 30
##   ..$ StudentizedRange: num 5.44
##   ..$ alpha           : num 0.05
##  $ means     :'data.frame':  30 obs. of  9 variables:
##   ..$ wue: num [1:30] 9.13 8.78 10.71 9.97 9.19 ...
##   ..$ std: num [1:30] 0.501 0.489 0.926 1.053 0.639 ...
##   ..$ r  : int [1:30] 5 5 5 5 5 5 5 5 5 5 ...
##   ..$ se : num [1:30] 0.712 0.712 0.712 0.712 0.712 ...
##   ..$ Min: num [1:30] 8.62 8.37 9.59 8.45 8.33 ...
##   ..$ Max: num [1:30] 9.97 9.6 12.13 11.4 9.82 ...
##   ..$ Q25: num [1:30] 8.95 8.48 10.38 9.79 8.71 ...
##   ..$ Q50: num [1:30] 9.03 8.62 10.59 9.97 9.41 ...
##   ..$ Q75: num [1:30] 9.09 8.83 10.88 10.21 9.67 ...
##  $ comparison: NULL
##  $ groups    :'data.frame':  30 obs. of  2 variables:
##   ..$ wue   : num [1:30] 13.6 12.9 12.9 12 11.8 ...
##   ..$ groups: chr [1:30] "a" "ab" "ab" "abc" ...
##  - attr(*, "class")= chr "group"

grupos <- tukey_interaccion$groups %>% 
  rownames_to_column("Tratamientos") %>% 
  separate("Tratamientos", into = c("riego","geno"))

str(grupos)
## 'data.frame':    30 obs. of  4 variables:
##  $ riego : chr  "sequia" "sequia" "sequia" "sequia" ...
##  $ geno  : chr  "G05" "G11" "G03" "G15" ...
##  $ wue   : num  13.6 12.9 12.9 12 11.8 ...
##  $ groups: chr  "a" "ab" "ab" "abc" ...
ggplot(grupos, aes(x = geno, y = wue, fill = riego)) +
  geom_bar(stat = "identity", position = position_dodge()) +
  geom_text(aes(label = groups), 
            position = position_dodge(width = 0.9), 
            vjust = -0.3, 
            size = 3) +  
  labs(title = "Efecto de Geno y Riego en WUE",
       x = "Genotipo",
       y = "WUE") +
  theme_minimal() +
  scale_fill_discrete(name = "Riego") +
  theme(axis.text.x = element_text(angle = 45, hjust = 1))

7 Discusión